Problem G
Overton Window
The Overton window is the range of policies politically
acceptable to the mainstream population at a given time. It is
important for politicians to find the Overton window so they
can avoid causing outrage with policy proposals. They avoid
being seen as extremist, they will only propose policies which
are within the Overton window. The Overton window is defined as
the set of policies formed by some weighted average of the
voters’ ideal policies. Given a list of
Input
The first line contains an integer
Output
First output
Give the lexicographical minimum rotation of these voters in counterclockwise order. If multiple voters have equal ideal policies, you should pick the one that appears first in the input.
Sample Input 1 | Sample Output 1 |
---|---|
1 0 0 |
1 1 |
Sample Input 2 | Sample Output 2 |
---|---|
3 0 0 2 -1 -2 1 |
2 2 3 |
Sample Input 3 | Sample Output 3 |
---|---|
7 0 0 0 1 -1 0 -10 -10 -10 10 5 5 6 6 |
5 1 7 2 5 4 |
Sample Input 4 | Sample Output 4 |
---|---|
6 -1000000000 -1000000000 999999998 1000000000 1000000000 999999996 -1 0 2 0 0 0 |
4 1 5 3 2 |