#Z14116. 津津的储蓄计划

津津的储蓄计划

Description

Jinjin's pocket money has always been managed by herself. At the beginning of each month, her mother gives her 300 yuan, and Jinjin budgets her expenses for the month, always ensuring that her actual spending matches the budget.

To teach Jinjin how to save, her mother proposed that Jinjin can deposit any whole hundred yuan with her at any time, and at the end of the year, she will return the deposited amount plus 20%.

Thus, Jinjin devised a savings plan: at the beginning of each month, after receiving the pocket money from her mother, if she expects that by the end of the month she will have more than or exactly 100 yuan left, she will deposit the whole hundred yuan with her mother and keep the remaining money for herself.

For example, at the beginning of November, Jinjin had 83 yuan left, and her mother gave her 300 yuan. Jinjin’s budget for November is 180 yuan, so she will deposit 200 yuan with her mother and keep 183 yuan for herself. By the end of November, Jinjin will have 3 yuan left.

Now, based on Jinjin’s monthly budgets from January to December 2004, determine whether this situation will occur. If not, calculate how much money Jinjin will have at the end of 2004 after her mother returns the deposited money plus 20%.

Input Format

The input consists of 12 lines, each containing a non-negative integer less than 350, representing Jinjin’s budget for each month from January to December.

Output Format

The output contains only one integer.
If there is a month where Jinjin does not have enough money during the savings plan, output -X, where X is the first such month. Otherwise, output the amount of money Jinjin will have at the end of 2004.

290
230
280
200
300
170
340
50 
90 
80 
200
60

-7

290
230
280
200
300
170
330
50
90
80
200
60
1580