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
2012-06-16 18:19:04 Centurion
92
1
2
3
4
5
6
7
8
9
output?

Last edit: 2012-06-16 19:35:39
2012-05-31 11:51:45 Shubham.IIITM
:) Got AC....think of the situation when sum of all the mushrooms <100
:D
2012-04-13 13:51:13 god_father
u have to check only until sum is around 100 as soon as u get sum around 100 just check the key condition and print the sum....

Last edit: 2012-04-13 13:58:55
2012-03-29 01:47:48 Didika Kata
where is the comment of Paranoid? I can't see
2011-09-25 16:30:01 Laili Rochmah
@Paranoid Android
thank you so much


Last edit: 2011-09-25 16:31:40
2011-09-20 11:18:06 jayesh hathila
where's paranoids comment???
2011-09-12 18:39:17 Mohammad Oktri Raditya
simple. only need more test case. :D
remember. mario is not always get a score.
2011-09-01 18:49:31 manish kapoor
my code runs well for all inputs and gives desirable output still i m getting WA.why??
submission code=5592835
2011-06-06 22:06:18 Dark_night
@Paranold
thanks its really heplful......
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.