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-10-16 20:37:46 surayans tiwari(http://bit.ly/1EPzcpv)
accepted in first attempt
2014-10-04 23:15:27 Arun Karthikeyan
Thanks to @paranoid AC in 1 go
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-19 05:06:17 Kaushik G Kulkarni
AC..in first go :)
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
2014-07-22 07:52:03 Sahil Dua
Cleared all test cases mentioned in comments.
Still getting WA on 10th test case. Any more tricky cases?
2014-07-16 13:06:15 Hamim Raavi
for those getting WA on test case 9, make a test case starting with these numbers: 90 8 4 1 5 ....
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.