100 atcoder#ABC140C. [ABC140C] Maximal Value
[ABC140C] Maximal Value
Score : points
Problem Statement
There is an integer sequence of length whose values are unknown.
Given is an integer sequence of length which is known to satisfy the following:
Find the maximum possible sum of the elements of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible sum of the elements of .
3
2 5
9
can be, for example, ( , , ), ( , , ), or ( , , ). Among those candidates, = ( , , ) has the maximum possible sum.
2
3
6
6
0 153 10 10 23
53