give = 0
have = 300
stop = 0
for i in range(1,13):
use = int(input())
if (have-use) // 100 >0:
give += ((have-use) // 100)*100
have = ((have-use) % 100)
have +=300
elif have-use <0:
stop = i
break
if stop != 0:
print("-",end = "")
print(stop)
else:
have = int(give *1.2 +have)
print(have)
感谢大佬