Problem G
Gathering in Yorknew
Hunters from all over the world are gathering in
Yorknew — where the ‘International Hunter Programming
Contest
There is exactly one road leading to Yorknew — an infinitely long and narrow road. For simplicity, you can imagine the road as a straight line.
To avoid traffic jam, Yorknew city administrators have
decided to build two portals. It takes exactly
The administrators want to place the two portals at some
integer positions on the road, such that the total time it
takes for all
Input
The first line of the input contains exactly one integer
The second line contains exactly
Output
Print only one integer — the total time it takes for all Hunters to reach Yorknew city.
Explanation of sample test
There are
The time it takes for the
Sample Input 1 | Sample Output 1 |
---|---|
3 4 5 6 |
2 |