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
Vipul Pandey: 2013-01-19 15:22:28

problem description is very confusing.. but a very easy question if you understand it.

Last edit: 2013-01-19 15:22:44
nitin suri: 2012-12-30 18:11:08

Can any 1 tell whats wrong in my prog?
it's giving me WA
submission code = 8379963

strings: 2012-12-26 18:05:11

@ac srinivas, its 102... remember, mario takes all mushrooms in series... and what i thought after reading the statement !!!
tutorial !!!

code warrior: 2012-10-01 20:11:45

i solved it as modified knapsack..
getting WA...help

akb: 2012-09-17 21:21:51

"score a number of points as close as possible to
100"
I dunno what i started to think after reading this....:(

eliminator: 2012-09-17 16:51:26

simple if else :)
move to tutorial.....

AC Srinivas: 2012-08-21 10:01:17

@Centurion @darky
output should be 100 (92+8) right?

Sumit Kumar Satnalika: 2012-07-09 19:42:08

my code is working properly...still it is showing W.A....why????

napster: 2012-06-18 06:24:28

nice one!!!

Darky: 2012-06-16 21:00:37

@Centurion 102


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