#d11306. 序列和
序列和
Sequence Sum
Problem Description
Given a sequence of length , you may reverse one of its contiguous subsegments (possibly empty) so that the sum of the numbers at even indices is maximized.
Input Format
The first line contains an integer , the length of the sequence ().
The second line contains integers , the sequence ().
Output Format
Output one integer: the maximum possible sum of elements at even indices.
Sample Input
8
1 7 3 4 7 6 2 9
Sample Output
26