#P7883. Closest Pair Distance

    ID: 21068 Type: Default 1000ms 256MiB

Closest Pair Distance

Closest Pair Distance

Given n points on the 2D Euclidean plane, find the minimum distance between any two of these points.

The distance between two points \(p_i=(x_i,y_i)\) and \(p_j=(x_j,y_j)\) is given by the formula:

\(d(p_i, p_j)=\sqrt{(x_i-x_j)^2+(y_i-y_j)^2}\)

Output the minimum distance in fixed precision of 6 decimal places.

inputFormat

The first line contains an integer n, the number of points.

Each of the following n lines contains two floating point numbers representing the coordinates of a point.

outputFormat

Output a single line containing the smallest distance between any two points. The answer should be printed with 6 decimal places.

sample

2
0 0
3 4
5.000000