- Time limit: 1.00 s
- Memory limit: 512 MB
Given a sequence of integers, find the largest sum of a consecutive subsequence of odd length.
Input
The first line of input contains , the length of the sequence. The second line containts integers, , the elements of the sequence.
Output
Print the largest sum of a consecutive subsequence of odd length.
Constraints
Example
Input:
4 8 -7 9 1
Output:
10
The largest sum is given by the subsequence 8 -7 9
.