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
abhijeet gusain: 2014-03-20 15:05:23

eat all mushrooms

785227: 2013-12-04 17:34:30

Century after this :) Very easy problem ..

Sagar Grover: 2013-08-30 14:06:29

AC in 1st go! :D

maradona: 2013-08-17 13:22:03

@Paranoid :
thank you .

Rudradeep Mukherjee: 2013-07-16 14:56:25

Can anyone tell me the 9th test case? Always getting WA on the case :/

shashank: 2013-07-13 08:21:04

AC in first Attempt..

UTKARSH: 2013-07-09 15:03:48

http://ideone.com/NOw88s
plss help me just tell me a test case for which my code doesn't work!!pls help me!!

orange: 2013-07-05 09:26:22

most seldom explanation of problem!!!easy to understand!!!!

himanshu: 2013-06-12 09:04:24

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
Ashish : 2013-05-29 21:06:02

@Paranoid Android thanks for description


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