#P6247. [SDOI2012] 最近最远点对
[SDOI2012] 最近最远点对
Description
Given points on the Cartesian coordinate plane, find the distance between the two closest points and the distance between the two farthest points. Note that the distance is the straight-line (Euclidean) distance.
Input Format
The first line contains an integer .
The next lines each contain two non-negative floating-point numbers, and , representing the -coordinate and -coordinate of the -th point.
Output Format
Output one line with two floating-point numbers: the shortest distance and the longest distance. An error of at most is considered correct.
4
0.0 0.0
0.0 1.0
1.0 0.0
1.0 1.0
1.00 1.41
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , and all numbers in the input are non-negative and do not exceed in value.
Translated by ChatGPT 5
京公网安备 11011102002149号