Problem E
Meet Us in the Middle
Languages
en
is
Note: this is a continuation of Meet Me in the Middle.
There are
These voters want to find common ground where they agree. This common ground can take different shapes depending on where their ideal policies are located in the plane and how unhappy they are with the current state of affairs. Note that some voters are irrelevant because some other voter’s disc is completely within that voter’s disc and therefore can be removed.
-
Some of the discs do not intersect. It is impossible to find common ground in this case.
-
One of the discs is completely within all other discs. Then that voter represents the common ground.
-
There is a non-trivial intersection of discs. The intersection points of the circles which are inside all circles can be used to analyze the region further.
Input
The first line contains an integer
All coordinates are between
Output
Depending on which shape of common ground we have, output
-
impossible
-
voter and the number of the voter whose disc is completely within all other discs.
-
compromise followed by an integer
representing the number of intersection points. Then lines follow, each with two numbers and then a sequence of (at least two) integers representing the voters that create the intersection points. The intersection points should be sorted in lexicographical order by the voters that form them. Each list of voters should be sorted in ascending order.
Your output is considered correct if it has at most a
relative error of
Sample Input 1 | Sample Output 1 |
---|---|
1 0 0 10 |
voter 1 |
Sample Input 2 | Sample Output 2 |
---|---|
3 0 0 1 3 0 1 50 50 1000 |
impossible |
Sample Input 3 | Sample Output 3 |
---|---|
3 75 83 62 6 62 78 45 89 100 |
compromise 2 72.3890578633145208 21.0550003538713363 1 2 38.3225915023140836 132.9876755400156302 1 2 |
Sample Input 4 | Sample Output 4 |
---|---|
4 19 86 68 34 46 54 87 19 68 94 62 65 |
compromise 4 84.0646935600472246 66.2367600850177092 1 2 42.5915250314730091 22.2235157233531535 1 4 71.2032546416990518 85.1397220744462869 2 3 29.3682060413785008 55.0912222723337324 3 4 |
Sample Input 5 | Sample Output 5 |
---|---|
5 -4 -7 90 40 30 100 3 4 54 -6 10 70 0 -20 80 |
voter 3 |
Sample Input 6 | Sample Output 6 |
---|---|
5 0 2 3 0 2 2 2 0 2 0 -2 2 -2 0 2 |
compromise 1 0.0000000000000000 0.0000000000000000 2 3 4 5 |
Sample Input 7 | Sample Output 7 |
---|---|
5 -16 63 65 -63 16 65 8 -57 65 55 -10 65 -4 3 5 |
compromise 6 0.0000000000000001 0.0000000000000000 1 2 5 -6.5384615384615385 -1.3076923076923077 1 5 0.8904109589041096 4.0410958904109588 2 5 -8.0000000000000000 6.0000000000000000 3 4 5 -1.4615384615384615 7.3076923076923077 3 5 -8.8904109589041096 1.9589041095890412 4 5 |