Score : 400 points
There are N squares aligned in a row. The i-th square from the left contains an integer a_i.
Initially, all the squares are white. Snuke will perform the following operation some number of times:
After Snuke finishes performing the operation, the score will be calculated as the sum of the integers contained in the black squares. Find the maximum possible score.
The input is given from Standard Input in the following format:
N K a_1 a_2 ... a_N
Print the maximum possible score.
5 3 -10 10 -10 10 -10
10
Paint the following squares black: the second, third and fourth squares from the left.
4 2 10 -10 -10 10
20
One possible way to obtain the maximum score is as follows:
1 1 -10
0
10 5 5 -4 -5 -8 -4 7 2 -4 0 7
17