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
Centurion:
2012-06-16 18:19:04
92
|
|
Shubham.IIITM:
2012-05-31 11:51:45
:) Got AC....think of the situation when sum of all the mushrooms <100
|
|
god_father:
2012-04-13 13:51:13
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 |
|
Didika Kata:
2012-03-29 01:47:48
where is the comment of Paranoid? I can't see |
|
Laili Rochmah:
2011-09-25 16:30:01
@Paranoid Android
|
|
jayesh hathila:
2011-09-20 11:18:06
where's paranoids comment??? |
|
Mohammad Oktri Raditya:
2011-09-12 18:39:17
simple. only need more test case. :D
|
|
manish kapoor:
2011-09-01 18:49:31
my code runs well for all inputs and gives desirable output still i m getting WA.why??
|
|
Dark_night:
2011-06-06 22:06:18
@Paranold
|
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 |