hewmatt10's Dream

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type

hewmatt10 is dreaming about [REDACTED]! In his dream, [REDACTED] appears N times on the 2D plane, at N different points. Because hewmatt10 likes round objects, all of the N points appear on an ellipse centred at (0, 0) with its semi-major and semi-minor axes lying on the x and y-axes, respectively. hewmatt10 wants to be really close to [REDACTED], so he would like to find the distance between the 2 closest points. Can you help hewmatt10?

Input Specification

The first line will contain N. The next N lines will contains 2 real numbers x, y\ (-10^6 \le x, y \le 10^6), the coordinates of one of the points.

Output Specification

The distance between the 2 closest points. Your answer will be judged as correct if it is within an absolute or relative error of 10^{-6}.


Subtask 1 [30%]

2 \le N \le 10^3

Subtask 2 [70%]

2 \le N \le 2 \cdot 10^5

Sample Input

52.971372 -46.163430
48.437918 -48.556681
-60.234919 -41.540429
-63.111931 39.377980
-24.842362 56.659883
79.122941 20.681073
-11.977885 58.684788
-83.596602 8.292359
32.146228 -54.818804
-83.759327 7.438750

Sample Output



There are no comments at the moment.