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-01-19 15:22:28 Vipul Pandey
problem description is very confusing.. but a very easy question if you understand it.

Last edit: 2013-01-19 15:22:44
2012-12-30 18:11:08 nitin suri
Can any 1 tell whats wrong in my prog?
it's giving me WA
submission code = 8379963
2012-12-26 18:05:11 strings
@ac srinivas, its 102... remember, mario takes all mushrooms in series... and what i thought after reading the statement !!!
tutorial !!!
2012-10-01 20:11:45 code warrior
i solved it as modified knapsack..
getting WA...help
2012-09-17 21:21:51 akb
"score a number of points as close as possible to
100"
I dunno what i started to think after reading this....:(
2012-09-17 16:51:26 eliminator
simple if else :)
move to tutorial.....
2012-08-21 10:01:17 AC Srinivas
@Centurion @darky
output should be 100 (92+8) right?
2012-07-09 19:42:08 Sumit Kumar Satnalika
my code is working properly...still it is showing W.A....why????
2012-06-18 06:24:28 napster
nice one!!!
2012-06-16 21:00:37 Darky
@Centurion 102
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.