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

21 lines
394 B
C++

#include <cstdio>
int save, cur, touse;
int main()
{
for (int i = 1; i <= 12; i++)
{
cur += 300;
scanf("%d", &touse);
if (touse > cur)
{
printf("-%d", i);
return 0;
}
cur -= touse;
save += cur / 100 * 100;
cur %= 100;
}
printf("%d", cur + save * 6 / 5);
return 0;
}