P7631 [COCI 2010/2011 #5] GLJIVE

Description

There are $10$ mushrooms in front of Super Mario, arranged in a row. Picking each mushroom gives some score. Super Mario must pick mushrooms in the order they appear, but he does not have to pick them all. His goal is to get a total score as close to $100$ as possible. **The picked mushrooms must start from the first one and be consecutive.** If there are two totals equally close to $100$ (for example, $98$ and $102$), Mario will choose the larger one (here, $102$). Help Super Mario and tell him how many points he can get.

Input Format

The input consists of $10$ lines. Each line contains a positive integer $A_i$, representing the score obtained by picking the current mushroom, in the order Mario picks them.

Output Format

Output $1$ line with one integer, representing the score Mario can get.

Explanation/Hint

**[Sample Explanation #1]** Mario picks up to the $10$-th mushroom and gets $100$ points. **[Constraints]** For $100\%$ of the testdata, $1 \le A_i \le 100$. **[Notes]** The scoring for this problem follows the original COCI problem settings, with a full score of $30$. Translated from [COCI2010-2011](https://hsin.hr/coci/archive/2010_2011/) [CONTEST #5](https://hsin.hr/coci/archive/2010_2011/contest5_tasks.pdf) _**T1 GLJIVE**_. Translated by ChatGPT 5