#arc074b. [arc074_b]3N Numbers
[arc074_b]3N Numbers
Problem Statement
Let be a positive integer.
There is a numerical sequence of length , . Snuke is constructing a new sequence of length , , by removing exactly elements from without changing the order of the remaining elements. Here, the score of is defined as follows: the sum of the elements in the first half of the sum of the elements in the second half of .
Find the maximum possible score of .
Constraints
- is an integer.
Partial Score
- In the test set worth points, .
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible score of .
Sample Input 1
2
3 1 4 1 5 9
Sample Output 1
1
When and are removed, will be , which has a score of .
Sample Input 2
1
1 2 3
Sample Output 2
-1
For example, when are removed, will be , which has a score of .
Sample Input 3
3
8 2 2 7 4 6 5 3 8
Sample Output 3
5
For example, when , and are removed, will be , which has a score of .