Problem Description
Teacher Komila Sobirovna has desks in the class, arranged in a row. When a student sits at desk , the teacher's pleasure changes by .
There are exactly students in the class. Komila Sobirovna needs to seat all students at desks such that no two students sit at neighboring desks. Among all valid arrangements, find the one that maximizes the total pleasure.
Note: denotes the smallest integer greater than or equal to . For example, and .
Input Format
The first line contains an integer --- the number of desks.
The second line contains integers --- the impact of each desk on the teacher's pleasure.
Constraints:
, for each
Output Format
On a single line, print the maximum pleasure the teacher can get.
Scoring
| Subtask | Constraint | Points |
|---|---|---|
| is odd | ||
Notes
In the first sample, and students. Komila Sobirovna seats them at desks , , and . Total pleasure: .
In the second sample, and students. The only option is desks and . Total pleasure: .
Examples
6 5 2 -1 3 -4 7
15
3 -1 -2 -3
-4