Grad
A construction site is defined as a rectangle in the coordinate system with sides parallel to the coordinate axes, with one corner in (0,0) and the opposite corner in (X,Y). The entrance to the site is in the middle of the bottom side. There are N cranes on the construction site. Each crane is situated in a point on the site, it can rotate 360 degrees and the maximum reach is known for each crane. The truck unloads heavy equipment on the entrance of the site and after that the equipment is carried across the site by a sequence of crane movements. In each step, one crane picks up the equipment and leaves it at any place within the maximum reach of that crane.
] – (A,B) is the position of the crane, and C is its maximum reach, 0 ≤ A ≤ X, 0 ≤ B ≤ Y, 0 ≤ C ≤ 200. The next line contains an integer K, 3 ≤ K ≤ 30, the number of destinations. Each of the following N lines contains two integers D and E – (D,E) is the position of one destination,
0 ≤ D ≤ X, 0 ≤ E ≤ Y. [c]4 4
2
2 1 1
2 3 1
4
2 2
3 2
1 2
2 3
Output
DA
NE
NE
DA Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.