Hide

Problem O
Lazy Network Engineers

/problems/lazynetworkengineers/file/statement/en/img-0001.jpg
Optimal Network for Sample Input 1

Alice and Bob are network engineers working together to build a network of many devices. Unfortunately, they ran into a problem. Since they know you are a programmer, they need your help to determine their next steps. They have determined $N$ possible locations to set up their devices. To keep the costs for the network small, they will connect these devices with direct lines such that there’s exactly one path between any two locations—Alice and Bob believe this arrangement is called a “spanning tree” in CS lingo.

Alice and Bob have two additional requirements. First, since the propagation delay in a network is proportional to the distance between devices, they wish to minimize the length of the longest path between any two destinations, as measured by the sum of the Euclidean distances between all connections that are part of that path.

Second, to save even more money, their manager allowed them to exclude $1$ of the $N$ locations in their network so that exactly $N - 1$ are used (with $N-2$ edges in the spanning tree).

Your task now is to figure out which location should be excluded and the resulting minimum longest path.

Input

The first line contains one integer $N$. The following $N$ lines each contain $2$ integers, $X$ and $Y$, which are the coordinates of a location ($3 \le N \le 200$, $-1\, 000 \le X, Y \le 1\, 000$). No location will be repeated.

Output

Print $2$ lines. The first line should have $2$ space separated integers $X$ and $Y$ that describe the location to exclude. If there are multiple points that you could exclude to minimize the longest path, output any of them. The second line should be the minimum longest path of the resulting spanning tree network after this location is excluded. This value will be accepted if its relative or absolute error is within $10^{-5}$.

Sample Input 1 Sample Output 1
7
2 8
1 0
10 8
10 1
7 0
0 8
20 20
20 20
19.978
Sample Input 2 Sample Output 2
3
0 0
0 1
1 0
0 1
1.000

Please log in to submit a solution to this problem

Log in