#P2093. [国家集训队] JZPFAR
[国家集训队] JZPFAR
Description
There are points on the plane. There are queries. In each query, given a point and an integer , output the index of the -th farthest point from among the points. If two (or more) points have the same distance to , then the point with the smaller index is considered farther.
Input Format
The first line contains an integer , the number of points. The next lines each contain two integers , the coordinates of the points. The indices of the points follow the input order and are . The next line contains an integer , the number of queries. The next lines each contain three integers , describing a query.
Output Format
Output lines. Each line contains one integer, the answer to the corresponding query.
3
0 0
0 1
0 2
3
1 1 2
0 0 3
0 1 1
3
1
1
Hint
- Constraints and Notes.
- In of the testdata, the coordinates of the points are randomly distributed within some range.
- In of the testdata, , , , . Any two points among the points have different coordinates. The coordinates of the query points in the queries are randomly distributed within some range.
Translated by ChatGPT 5
京公网安备 11011102002149号