| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 171 | 109 | 99 | 69.718% |
Perhaps farming isn’t the healthiest of occupations. You’ve grown suspicious of your animals. Upon examining them, you’ve noticed that some animals tend to stay oddly close to one another. They’re likely conferring against you. In order to know which two animals to keep the closest eye on, create a program that finds the closest two animals to each other.
The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will start with a single integer z denoting how many animals are under examination. The next z lines will consist of two non negative integers x and y, denoting the x and y coordinate of each animal.
For each test case, output the locations of the two closest animals, sorted by x, and then by y in the case of a tie. If there are two such closest pairs of points, choose the smallest sorted pair, i.e., with respect to the first points x, then first point’s y, then second point’s x, and finally second point’s y.
2 11 90 60 80 30 12 94 13 43 24 40 26 86 30 60 32 63 70 50 60 96 34 20 5 2 0 1 0 0 0 1 1 0 1
30 60 32 63 0 0 0 1