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
surayans tiwari(http://bit.ly/1EPzcpv): 2014-10-16 20:37:46

accepted in first attempt

Arun Karthikeyan: 2014-10-04 23:15:27

Thanks to @paranoid AC in 1 go

Gaurav Ahirwar: 2014-09-30 09:54:51

F**king Misleading Statement! costed me tough time and 2 WA.. .thanks to Paranoid Android! for your more clear statement. Finally got it submitted!

jack sparrow: 2014-09-24 14:26:31

@vaibhav 90

Kaushik G Kulkarni: 2014-09-19 05:06:17

AC..in first go :)

vaibhav lalka: 2014-09-08 15:10:16

90 92 93 96 5 95 94 97 2 4
for this test case
what is the answer

s: 2014-09-03 21:09:03

i did not understand the problem

Darren Sun: 2014-07-29 11:00:20

Go to the last page of the comments and read a clearer description of the problem paraphrased by paranoid android

Sahil Dua: 2014-07-22 07:52:03

Cleared all test cases mentioned in comments.
Still getting WA on 10th test case. Any more tricky cases?

Hamim Raavi: 2014-07-16 13:06:15

for those getting WA on test case 9, make a test case starting with these numbers: 90 8 4 1 5 ....


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