P29669 [洛谷] [COCI2010-2011#5] GLJIVE
普及-
题目描述

Problem Description

In front of Super Mario, there are 10 mushrooms arranged in a row. Each mushroom grants a certain number of points when picked.

Super Mario must pick the mushrooms in the order they appear, but he does not have to pick all of them—his goal is to get as close to 100 points as possible. The mushrooms picked must start from the first one and be consecutive.

If there are two numbers equally close to 100 (e.g., 98 and 102), Mario will choose the larger one (which is 102).

Help Super Mario by telling him how many points he can get.

Input Format

The input consists of 10 lines, each containing a positive integer \( A_i \), representing the points awarded for picking the current mushroom, in the order Mario picks them.

Output Format

The output consists of one line, containing an integer, representing the points Mario can get.

Sample Input and Output

Sample Input #1

10
20
30
40
50
60
70
80
90
100

Sample Output #1

100

Sample Input #2

1
2
3
5
8
13
21
34
55
89

Sample Output #2

87

Sample Input #3

40
40
40
40
40
40
40
40
40
40

Sample Output #3

120

Notes

[Sample Explanation #1]

Mario picks the 10th mushroom and gets 100 points.

[Data Range]

For 100% of the data, \( 1 \le A_i \le 100 \).

[Explanation]

This problem is scored according to the original COCI settings, with a maximum score of 30 points.

The problem is translated from COCI2010-2011 CONTEST #5 T1 GLJIVE.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 20 30 40 50 60 70 80 90 100
样例输出
100