You are given an array .
A machine receives a non-empty array and returns a number. For an array of length , it returns .
For an array of length greater than , the machine chooses one of the boundaries between two consecutive elements and splits the array into two non-empty arrays and .
Then the machine gets , and adds exactly one of the following two values to it:
Here denotes the sum of all elements of array .
The value is the maximum possible final value over all choices of splits and added values.
For each test case, output .
The array has length , so the machine returns .
There is only one split. The two sums are and , so the best added value is .
An optimal splitting of the array is as follows: and . Then we have: .