-->
当前位置:首页 > 题库

PROGRAMMING:Save 007 (upgrade)

Luz5年前 (2021-05-10)题库392
In the old movie "live and let die", there is a plot in which 007 is caught by a drug dealer on an island in the center of an alligator pool. He uses a very bold way to escape - he jumps ashore directly on a series of alligator brain bags in the pool( It is said that the stand in actor was bitten by the last crocodile. Fortunately, he escaped by wearing extra thick boots.)
Let the crocodile pool be a square with 100 meters in length and width, with the center coordinates of (0,0) and the northeast corner coordinates of (50,50). Chixin island is a 15 meter circle with (0,0) as its center. Given the coordinates of the crocodiles distributed in the pool and the maximum distance 007 can jump at a time, you need to show him the shortest escape path - the so-called "shortest" means 007 has the least number of steps to jump.
###Input format:
First of all, the first line gives two positive integers: the number of crocodiles $$n $$($$Le 100 $$) and the maximum distance 007 can jump $$d $. Next, there are $$n $$lines, each of which gives the $$(x, y) $$coordinates of an alligator. Note: there won't be two crocodiles at the same point.
###Output format:
If 007 is likely to escape, first output the minimum number of steps 007 needs to jump in the first line, and then from the second line, each line gives the coordinates of the crocodile to jump to from the pool island to the shore $$(x, y) $. If it is impossible to escape, output 0 as the number of jump steps in the first line. If the shortest path is not unique, the nearest solution of the first hop is output. The problem guarantees that such a solution is unique.
###Input sample 1:
```in
17 15
10 -21
10 21
-40 10
30 -50
20 40
35 10
0 -10
-25 22
40 -40
-30 30
-10 22
0 11
25 21
25 10
10 10
10 35
-30 10
```
###Output sample 1:
```out
four
0 11
10 21
10 35
```
###Input example 2:
```in
4 13
-12 12
12 12
-12 -12
12 -12
```
###Output example 2:
```out
0
```







answer:If there is no answer, please comment