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
2013-05-20 09:01:02 !!.Nginx.!!
Tricky to understand....nice but easy problem. :)
2013-05-17 20:32:19 Chandan Mittal
my code gives all ans correct but still WA here:(
<snip>
pls help

Last edit: 2022-09-27 22:49:23
2013-05-09 17:02:30 triple M
take care about this test case
1
2
3
4
5
6
7
8
9
10
output :
55
2013-03-26 05:14:12 suryadev
thanks centurion and darky
your comments helped me to correct my mistake
2013-03-22 12:25:58 Myfirstapp
please, if you love your time, then please read paranoid comment once.(before solving this question) thanks
2013-03-18 14:38:29 Raghavan
@Paranoid Android thanks for description

Last edit: 2013-03-18 14:39:28
2013-02-25 16:28:30 AnasMourad
anyone can explain the statement , please ? or explain the I/O
2013-02-20 07:48:42 shiv prasad chabarval
u must start picking from 1st
2013-02-16 14:49:26 Ouditchya Sinha
Finally AC :) Quite a confusing description of the problem, @Paranoid Android , thank you for the explanation of problem statement...
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.