Vincent Massey SS - 2014 Senior Contest #1
Firebending is the element of power. Firebenders use their energy to create bursts of fire in order to overwhelm their opponent. As a result, they want to maximize the value of each fire blast that they shoot. In order to do so, they must revisit the art of mathematics.
You will be given
Input Specification
The first line will contain the integer
The next
Output Specification
The largest possible final sum of the
Sample Input
Copy
3
1
-2
3
Sample Output
Copy
6
Explanation
Keep
Change
Keep
Thus, the answer is
Comments
Being negative can never contribute to maximizing your happiness.