PARTPLNE - Partitioning the plane
You are given the coordinates of 4×K+5 points on a plane such that no three of them are collinear. You need to select five points from these : a central point O and four arm points A, B, C, D such that:
- Rays from the centre to the arm points divide the plane into four regions containing an equal number of points.
- None of the four central angles is a reflex angle.
- Sum of absolute values of the cotangents of the central angles is as low as possible.
If it is possible to choose points satisfying this condition, output the lowest possible value for the sum of absolute values of the cotangents of the central angles. Otherwise report that it is not possible.
Input
The first line of input contains T (≤ 4), the number of test cases. Following this are the descriptions of the T test cases.
The first line in the description of each test case gives K (≤ 100). Following this are 4×K+5 lines giving the x and y coordinates of each point separated by a space (0 ≤ x, y ≤ 106)
Output
For each test case output in a different line the minimum sum of absolute values of the cotangents of the central angles, with six digits after the decimal point. If the division cannot be done in the manner explained, print Impossible.
Example
Input:
2
0
0 0
0 1
1 1
1 0
2 3
0
0 0
2 0
0 1
2 1
1 2
Output:
4.500000
Impossible
hide comments
Raziman T V:
2011-02-15 23:52:43
Thanks. Corrected |
|
olimpoUS:
2011-02-15 23:52:27
I think that output example is wrong for first case.
|
Added by: | Raziman T V |
Date: | 2011-02-13 |
Time limit: | 1.181s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | IOPC2011 |