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
Arun: 2014-06-24 02:13:53

giving AC on all test case given in comments but WA on 10th test case

viraj: 2014-06-17 10:42:48

@himanshu shouldnt the answer to the 1st testcase be 101 ? (100+1)

pandu ranga rao: 2014-06-13 06:21:26

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
Aditya jain: 2014-05-27 06:42:26

Finally...after many WA..silly mistakes:/@ankur arora thanks

Last edit: 2014-05-27 06:43:17
Ankur Arora: 2014-05-26 20:59:41

easy

WA: 2014-05-13 12:44:37

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
Abhinav Gupta: 2014-05-10 07:44:23

Very contradictory problem statement!! Try sth else!!

SHIVAM DIXIT: 2014-04-26 12:54:58

read paranoid android's comment for clear understanding of the problem.....its very easy problem, once you understand it...

RAJAT SINGH: 2014-03-25 04:00:35

got AC in first attempt........easy one

TAUSHIF ALI: 2014-03-21 20:56:38

@Paranoid :
thank you .
question statement is quite confusing


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