Problem C
Big Totoro

Big Totoro is currently eating big acorns. There are
Big Totoro starts off at size
After eating a big acorn, it disappears and can no longer be eaten. Calculate the maximum size Big Totoro can achieve.
Input
The first line of input contains two space-separated
integers
Output
The first line of output should contain a single integer, representing the maximum size Big Totoro can achieve.
Sample Input 1 | Sample Output 1 |
---|---|
4 3 7 4 6 8 |
28 |
Sample Input 2 | Sample Output 2 |
---|---|
3 5 0 8 1 |
6 |