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

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

hide comments
2014-03-20 15:05:23 abhijeet gusain
eat all mushrooms
2013-12-04 17:34:30 785227
Century after this :) Very easy problem ..
2013-08-30 14:06:29 Sagar Grover
AC in 1st go! :D
2013-08-17 13:22:03 maradona
@Paranoid :
thank you .
2013-07-16 14:56:25 Rudradeep Mukherjee
Can anyone tell me the 9th test case? Always getting WA on the case :/
2013-07-13 08:21:04 shashank
AC in first Attempt..
2013-07-09 15:03:48 UTKARSH
http://ideone.com/NOw88s
plss help me just tell me a test case for which my code doesn't work!!pls help me!!
2013-07-05 09:26:22 orange
most seldom explanation of problem!!!easy to understand!!!!
2013-06-12 09:04:24 himanshu
finally got ac :)
note........
you should access all elements sequently and
tricky cases are......
1)
99
100
1
0
0
0
0
0
0
0
answer is 99

2)
80
40
0
0
0
0
0
0
0
0
answer is 120

Last edit: 2013-06-14 09:57:27
2013-05-29 21:06:02 Ashish
@Paranoid Android thanks for description
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.