You will be given N 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:
D=(x2−x1)2+(y2−y1)2
Input
The input will start with N (1≤N≤1000), the number of coordinates. Then N lines will follow, each with a pair of integers Xi and Yi (−1000≤Xi,Yi≤1000) representing the x and y coordinates of the points.
Output
Print the distance between the closest pair from among the given points. Absolute or relative error greater than 10−4 will be ignored.
Sample
Input
Output
3
1 1
2 7
3 5
2.23606797749979
The two closest points are (2,7) and (3,5). The distance between these two points is 2.23606797749979.