#P7631. [COCI 2010/2011 #5] GLJIVE

[COCI 2010/2011 #5] GLJIVE

Description

There are 1010 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 100100 as possible. The picked mushrooms must start from the first one and be consecutive.

If there are two totals equally close to 100100 (for example, 9898 and 102102), Mario will choose the larger one (here, 102102).

Help Super Mario and tell him how many points he can get.

Input Format

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

Output Format

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

10
20
30
40
50
60
70
80
90
100 
100
1
2
3
5
8
13
21
34
55
89 

87
40
40
40
40
40
40
40
40
40
40 

120

Hint

[Sample Explanation #1]

Mario picks up to the 1010-th mushroom and gets 100100 points.

[Constraints]

For 100%100\% of the testdata, 1Ai1001 \le A_i \le 100.

[Notes]

The scoring for this problem follows the original COCI problem settings, with a full score of 3030.

Translated from COCI2010-2011 CONTEST #5 T1 GLJIVE.

Translated by ChatGPT 5