You will be given pair of coordinates on a 2D space. You will determine distance between the closest pair of points.
The distance between any two points is calculated as:
The input will start with (), the number of coordinates. Then lines will follow, each with a pair of integers and () representing the and coordinates of the points.
Print the distance between the closest pair from among the given points. Absolute or relative error greater than will be ignored.
Input | Output |
---|---|
3 1 1 2 7 3 5 | 2.23606797749979 |
The two closest points are and . The distance between these two points is 2.23606797749979. |