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
!!.Nginx.!!: 2013-05-20 09:01:02

Tricky to understand....nice but easy problem. :)

Chandan Mittal: 2013-05-17 20:32:19

my code gives all ans correct but still WA here:(
<snip>
pls help

Last edit: 2022-09-27 22:49:23
triple M: 2013-05-09 17:02:30

take care about this test case
1
2
3
4
5
6
7
8
9
10
output :
55

suryadev: 2013-03-26 05:14:12

thanks centurion and darky
your comments helped me to correct my mistake

Myfirstapp: 2013-03-22 12:25:58

please, if you love your time, then please read paranoid comment once.(before solving this question) thanks

Raghavan: 2013-03-18 14:38:29

@Paranoid Android thanks for description

Last edit: 2013-03-18 14:39:28
AnasMourad: 2013-02-25 16:28:30

anyone can explain the statement , please ? or explain the I/O

shiv prasad chabarval: 2013-02-20 07:48:42

u must start picking from 1st

Ouditchya Sinha: 2013-02-16 14:49:26

Finally AC :) Quite a confusing description of the problem, @Paranoid Android , thank you for the explanation of problem statement...


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