Problem: Danny, the local Math Maniac, is fascinated by circles, Omkar's most recent creation. Help him solve this circle problem!
You are given nonnegative integers arranged in a circle, where must be odd (ie. is divisible by ). Formally, for all such that , the elements and are considered to be adjacent, and and are also considered to be adjacent. In one operation, you pick a number on the circle, replace it with the sum of the two elements adjacent to it, and then delete the two adjacent elements from the circle. This is repeated until only one number remains in the circle, which we call the circular value.
Help Danny find the maximum possible circular value after some sequences of operations.
Input Format: The first line contains one odd integer (, is odd) — the initial size of the circle.
The second line contains integers () — the initial numbers in the circle.
Output Format: Output the maximum possible circular value after applying some sequence of operations to the given circle.
Note: For the first test case, here's how a circular value of is obtained:
Pick the number at index . The sum of adjacent elements equals . Delete and from the circle and replace with .
Note that the answer may not fit in a -bit integer.