#K95182. Closest Distance Between Points
Closest Distance Between Points
Closest Distance Between Points
You are given n points in a 2D plane. Your task is to compute the minimum Euclidean distance between any two distinct points. The Euclidean distance between two points \( (x_i, y_i) \) and \( (x_j, y_j) \) is defined as:
\( d = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2} \)
Print the result formatted to exactly six decimal places.
Note: The input is provided via standard input and the output should be written to standard output.
inputFormat
The first line contains an integer n, the number of points. Each of the following n lines contains two space-separated integers representing the x and y coordinates of a point.
outputFormat
Print one line containing the minimum distance between any two points, formatted to six decimal places.## sample
3
0 0
3 4
1 1
1.414214