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
ashimk:
2018-03-17 11:51:56
Unclear explanation of the problem costed me 3 WA's ..... Deserves Downvote :p)
|
|
rob_in_1:
2018-03-05 19:21:51
10 20 30 50 60 70 75 80 90 100
|
|
ameyanator:
2018-03-01 15:56:09
yaasss! My 100th!! :D
|
|
srjsunny:
2018-02-22 20:53:14
question statement not at all clear |
|
prakash1108:
2018-01-15 13:16:19
if sum>100,break the loop ,i.e not take all the input. |
|
mpride44:
2017-12-28 19:50:43
ac in 1 go...
|
|
shubhamkr2020:
2017-12-21 17:41:09
Why so many downvotes ??
|
|
nermatibhanu:
2017-06-03 08:49:02
Please read comments to get clarity abt question |
|
anurag_333:
2017-05-31 19:32:05
can anyone tell me how it could have been done if the question was as we understood at first i.e
|
|
mrigank9:
2017-05-05 08:30:26
AC in one go :) comments are the key :p |
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 |