You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
453 B

#include <bits/stdc++.h>
using namespace std;
int Left, save;
int main() {
for (int i = 1; i <= 12; i++) {
Left += 300;
int x;
cin >> x;
Left = Left - x;
if (Left < 0) {
printf("-%d", i);
exit(0);
}
int cnt = Left / 100;
save += (100 * cnt);
Left -= (100 * cnt);
}
printf("%d", (int)(1.2 * save) + Left);
return 0;
}