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-06-24 02:13:53 Arun
giving AC on all test case given in comments but WA on 10th test case
2014-06-17 10:42:48 viraj
@himanshu shouldnt the answer to the 1st testcase be 101 ? (100+1)
2014-06-13 06:21:26 pandu ranga rao
can some answer for this test case.:

50 48 4 60 100 47 85 50 49 5

Last edit: 2014-06-13 06:23:43
2014-05-27 06:42:26 Aditya jain
Finally...after many WA..silly mistakes:/@ankur arora thanks

Last edit: 2014-05-27 06:43:17
2014-05-26 20:59:41 Ankur Arora
easy
2014-05-13 12:44:37 WA
very unclear problem statement...always start picking from the 1st mushroom till the point reaches close to 100

Last edit: 2014-05-13 12:45:05
2014-05-10 07:44:23 Abhinav Gupta
Very contradictory problem statement!! Try sth else!!
2014-04-26 12:54:58 SHIVAM DIXIT
read paranoid android's comment for clear understanding of the problem.....its very easy problem, once you understand it...
2014-03-25 04:00:35 RAJAT SINGH
got AC in first attempt........easy one
2014-03-21 20:56:38 TAUSHIF ALI
@Paranoid :
thank you .
question statement is quite confusing
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.