#P7631. Mushroom Collector
Mushroom Collector
Mushroom Collector
Super Mario is faced with 10 mushrooms arranged in a row. Each mushroom gives him a certain score when collected. He must pick mushrooms in the order they appear, starting from the first one, and his picks must form a contiguous segment. His goal is to collect mushrooms so that the total score is as close to \(100\) as possible.
If there are two possible scores that are equally close to \(100\) (for example, \(98\) and \(102\)), Mario will choose the larger one (in this example, \(102\)).
Help Super Mario determine the score he will get.
inputFormat
The input consists of a single line containing 10 space-separated integers. Each integer represents the score of a mushroom in the order they appear.
outputFormat
Output a single integer: the total score of the contiguous segment beginning with the first mushroom which is as close as possible to \(100\) (choosing the larger one in case of a tie).
sample
10 20 30 40 50 60 70 80 90 100
100