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
mukesh tiwari:
2011-05-20 17:39:46
read the Paranaoid Android comments before solving this problem. |
|
sudipto das:
2011-04-27 14:54:37
problem description is misleading... |
|
Anurag Atri:
2011-03-15 17:13:30
@Paranoid :
|
|
S:
2011-03-05 08:28:08
@Paranoid Android
|
|
Rachmawan Atmaji Perdana:
2011-03-05 00:41:25
How much you'll take at the k-th row is the summation from row 1 to k |
|
S:
2011-03-04 19:20:38
@Paranoid Android
|
|
Paranoid Android:
2011-03-04 06:58:53
For those who can't decipher what the problem asks please read my rephrased statement below :
|
|
Mohamed Ramzy:
2011-02-24 15:19:36
still i can't understand it , someone explain what is required.
|
|
:D:
2011-02-21 18:40:58
You can take any contiguous sequence of mushrooms, starting from the first. |
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 |