| XXII Open Cup. Grand Prix of Seoul |
|---|
| Finished |
Clustering algorithms are algorithms that partition data into subsets named clusters, intending to place similar data into the same cluster and different data into different clusters.
Professor Jihoon Ko discovered the revolutionary clustering algorithm UCP-Clustering. Given $$$N$$$ distinct points in a 2-dimensional space, the algorithm partitions the points into $$$K$$$ clusters with the following algorithm.
Here, the following definitions are used:
For example, consider the case where $$$N = 3$$$ points $$$\{(1, 2), (3, 4), (5, 6)\}$$$ are clustered into $$$K = 2$$$ sets. Suppose that the points $$$(1, 2)$$$ and $$$(3, 4)$$$ are selected as RCs. The first iteration of the recompute algorithm clusters the points into $$$\{(1, 2)\}$$$ and $$$\{(3, 4), (5, 6)\}$$$ with their RCs being $$$(1, 2)$$$ and $$$(4, 5)$$$. The second iteration does not change the RCs, thus the recompute algorithm is executed twice. Suppose that the points $$$(1, 2)$$$ and $$$(5, 6)$$$ are selected as RCs. Then the first iteration of the recompute algorithm clusters the point into $$$\{(1, 2), (3, 4)\}$$$ and $$$\{(5, 6)\}$$$ with their RCs being $$$(2, 3)$$$ and $$$(5, 6)$$$. The second iteration does not change the RCs, thus the recompute algorithm is executed twice. From the above example, we can see that the initial choice of the RC may change the result of the clustering.
In this problem, let's focus on the case $$$K = 2$$$. Suppose that all $$$N(N-1)/2$$$ possible initial representative coordinates are chosen for each cluster equiprobably. Please find all the possible sets of representative coordinates at the end of the algorithm, and the expected value of execution count for recompute if the algorithm reaches this set of points.
The first line contains a single integer $$$N$$$ ($$$2 \le N \le 512$$$).
The next $$$N$$$ lines contain two integers $$$x_i$$$ and $$$y_i$$$ denoting point $$$(x_i, y_i)$$$. All points are distinct ($$$-10^6 \le x_i, y_i \le 10^6$$$).
Output all the possible sets of representative coordinates, one per line, in the following format.
Let $$$(x_1, y_1), (x_2, y_2)$$$ be the final representative coordinates. Output five real numbers $$$x_1, y_1, x_2, y_2, E$$$ where $$$(x_1, y_1)$$$ is lexicographically smaller than $$$(x_2, y_2)$$$, and $$$E$$$ is the expected value of execution count for compute if the algorithm reaches this set of points.
The sets must be printed in lexicographic order by $$$(x_1, y_1)$$$, with sets that have the same representative coordinate for $$$(x_1, y_1)$$$ printed in lexicographic order by $$$(x_2, y_2)$$$.
All values must be within an absolute or relative error of $$$10^{-6}$$$.
The input data are designed such that any choice of initial RC will not make the algorithm reach some state where any of the following conditions is true:
4 0 0 0 3 3 0 3 3
0.000000 0.000000 3.000000 3.000000 1.000000000000 0.000000 1.500000 3.000000 1.500000 2.000000000000 0.000000 3.000000 3.000000 0.000000 1.000000000000 1.500000 0.000000 1.500000 3.000000 2.000000000000
3 1 2 3 4 5 6
1.000000 2.000000 4.000000 5.000000 2.000000000000 2.000000 3.000000 5.000000 6.000000 2.000000000000
| Name |
|---|


