#P2847. Moo-cast Network

    ID: 16105 Type: Default 1000ms 256MiB

Moo-cast Network

Moo-cast Network

Farmer John's N cows (where \(1 \leq N \leq 1000\)) are planning an emergency "moo-cast" system to broadcast messages. Each cow is equipped with a walkie-talkie that can transmit to any other cow within a range of \(\sqrt{X}\), where \(X\) is the amount of money spent. Two cows can communicate directly if the squared Euclidean distance between them

[ (x_i - x_j)^2 + (y_i - y_j)^2 \leq X ]

Moreover, messages can be relayed through several cows. Find the minimum integer value of \(X\) such that a broadcast initiated by any cow eventually reaches every other cow.

inputFormat

The first line of input contains a single integer \(N\), the number of cows.

Each of the next \(N\) lines contains two space-separated integers, representing the \(x\) and \(y\) coordinates of a cow.

outputFormat

Output the minimum integer \(X\) such that a broadcast from any cow can reach every other cow.

sample

4
0 0
0 1
1 0
1 1
1