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-12-19 21:52:04 Aman Agarwal
getting WA on 10th judge..
any tricky case?
please help
AC

Last edit: 2014-12-20 12:02:39
2014-12-18 20:33:37 :.Mohib.:
Easy one....:)
2014-12-17 03:24:48 Prashant Jha
Guys, my 2 cents. Please do not be sarcastic in your comments even when the problem statement is not clear. English is not everyone's first language...and just the fact that they took the pain to post the question deserves our gratitude. We are here to solve problems, not to belittle someone. And our community is large and informed enough that, when such confusions do arise, someone is always there to better explain the problem statement.
2014-12-16 16:09:09 Rachit
F##k
clap clap clap
what a problem statement -_-
2014-10-29 02:29:54 Rajat (1307086)
Heres the comment of paranoid android:(no need to search back)
For those who can't decipher what the
problem asks please read my
rephrased statement below :
Select mushrooms in order starting
from 1. You can't select mushrooms
like 1,3,7 but it should be 1,2,3,4...10.
You can stop in between if you get a
value "closest" to 100. If there is a tie
between two numbers equally "close"
to 100 select the larger one.
If you are still not getting it type "coci
gljive" in google, then open the first
pdf link. There will be other sample
cases. That will help you to
understand.

Last edit: 2014-10-29 05:09:59
2014-09-30 09:54:51 Gaurav Ahirwar
F**king Misleading Statement! costed me tough time and 2 WA.. .thanks to Paranoid Android! for your more clear statement. Finally got it submitted!
2014-09-24 14:26:31 jack sparrow
@vaibhav 90
2014-09-08 15:10:16 vaibhav lalka
90 92 93 96 5 95 94 97 2 4
for this test case
what is the answer
2014-09-03 21:09:03 s
i did not understand the problem

2014-07-29 11:00:20 Darren Sun
Go to the last page of the comments and read a clearer description of the problem paraphrased by paranoid android
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.