#P1257. Minimum Pair Distance
Minimum Pair Distance
Minimum Pair Distance
Given n points in the 2D plane, find the pair of points with the minimum Euclidean distance. In other words, among all \( {n \choose 2} \) pairs of points, determine the pair whose distance is the smallest.
The Euclidean distance between two points \( (x_i, y_i) \) and \( (x_j, y_j) \) is given by:
$$ d = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2} $$
inputFormat
The first line contains an integer n
(n ≥ 2) denoting the number of points.
The following n
lines each contain two real numbers x
and y
indicating the coordinates of each point.
outputFormat
Output a single line with the minimum Euclidean distance among all pairs of points. The answer should be printed with 6 decimal places of precision.
sample
2
0 0
0 1
1.000000