GLJIVE - GLJIVE


In front of Super Mario there are 10 mushrooms, arranged in a row. A certain amount of points is awarded for picking each of the mushrooms. Super Mario must pick mushrooms in order they appear, but is not required to pick them all – his goal is to score a number of points as close as possible to 100.

In case there exist two such numbers which are equally close to 100 (e.g. 98 and 102), Mario will pick the greater one (in this case 102).

Help Super Mario and tell him how many points he will score.

Input

Input consists of 10 lines, each of which contains one positive integer less than or equal to 100, denoting the scores awarded for picking each mushroom, in the order that Mario can pick them in.

Output

The first and only line of output must contain the required number of points.

Example

Input:
10
20
30
40
50
60
70
80
90
100

Output:
100

hide comments
Efim: 2011-02-21 13:26:23

For example, can he pick only first and lash mushroom?

Michael T: 2011-02-20 10:20:44

Aye. This "in order" is misleading.

A. Muh. Primabudi: 2011-02-19 19:17:03

Im Agree with He Liang, i just waste 1 hour to do a misunderstand problem(and WA). :(

He Liang: 2011-02-17 06:29:51

The problem description is rather bad. If I didn't read the other example and other people's solution on COCI, I think it's impossible to get the real meaning.

akaki: 2011-02-15 15:48:03

I hadn't added test cases and thats why it gives "internal error"

Siarhei Kulik: 2011-02-13 16:19:53

What does "internal error" means?

EDIT: My solution got AC on COCI but WA here. Please, check your test cases.

Last edit: 2011-02-13 16:34:59

Added by:akaki
Date:2011-02-13
Time limit:0.205s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:coci