#Lutece3309. The Circle Game

The Circle Game

Description

And the seasons they go round and round
And the painted ponies go up and down
We're captive on the carousel of time
We can't return, we can only look behind from where we came
And go round and round and round in the circle game...

-- Joni Mitchell, The Circle Game

One day, vv123 thought of the days when he played circle game with his classmates in PE class, when he was just an elementary school student.

There are nn (nn is even) kids forming a circle hand by hand, the strength of the nn kids are 1,2,,n1,2,\ldots,n respectively. vv123 wants to rearrange the kids in the circle, so that the circle is firmest.

Suppose that the villain can only attack half the circle at a time, and it will obviously attack the weakest part of the circle. So, we define the firmness of the circle as the smallest sum of any n2\frac{n}{2} consecutive kids' strength.

For the given nn, what's the maximum firmness that can be achieved?

Input

An integer nn (2n100002\le n \le 10000). It is guaranteed that nn is even.

Output

An integer, denoting the maximum firmness that can be achieved.

Samples

4
4
6
10

Note

In the first example, n=4n = 4, there are 66 ways to form the circle:

  • 123411-2-3-4-1, the firmness is min(1+2,2+3,3+4,4+1)=3\min (1+2,2+3,3+4,4+1) = 3.
  • 124311-2-4-3-1, the firmness is min(1+2,2+4,4+3,3+1)=3\min (1+2,2+4,4+3,3+1) = 3.
  • 132411-3-2-4-1, the firmness is min(1+3,3+2,2+4,4+1)=4\min (1+3,3+2,2+4,4+1) = 4.
  • 134211-3-4-2-1, the firmness is min(1+3,3+4,4+2,2+1)=3\min (1+3,3+4,4+2,2+1) = 3.
  • 142311-4-2-3-1, the firmness is min(1+4,4+2,2+3,3+1)=4\min (1+4,4+2,2+3,3+1) = 4.
  • 143211-4-3-2-1, the firmness is min(1+4,4+3,3+2,2+1)=3\min (1+4,4+3,3+2,2+1) = 3.

So, the maximum firmness that can be achieved is 44.

In the second example, there are 120120 ways to form the circle. The maximum firmness that can be achieved is 1010, and one possible way to achieve this is 14523611-4-5-2-3-6-1.

Resources

电子科技大学第十三届 ACM 趣味程序设计竞赛