Skip to content

Instantly share code, notes, and snippets.

@TortoiseWrath TortoiseWrath/timelimits.cpp Secret
Created Jan 16, 2019

Embed
What would you like to do?
#include <iostream>
using namespace std;
int main(void) {
int n, s;
cin >> n >> s;
int maxj = 0;
for(int i = 0; i < n; i++) {
int m;
cin >> m;
if(m > maxj) {
maxj = m;
}
}
maxj *= s;
if(maxj % 1000) maxj = maxj/1000 + 1;
else maxj /= 1000;
cout << maxj << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.