#P15836. [蓝桥杯第一届国际赛] 捕鱼达人
[蓝桥杯第一届国际赛] 捕鱼达人
Problem Description
Xiaoming is playing a fishing game on a plane. There are fish on the plane, and the coordinates of the -th fish are .
At each moment, Xiaoming may choose one fish that is still on the plane and cast a net at its position. That fish will be caught in the net, and at the same time, all fish whose (Euclidean) distance to that fish is no more than will also be caught in the net. The caught fish are taken away by Xiaoming and disappear from the plane. Note that Xiaoming can only choose a fish that is still on the plane (not yet taken away) to cast the net. If there are no fish, he cannot cast the net.
Xiaoming wants to know the minimum number of net casts needed to catch all fish.
Hint: The Euclidean distance between two points and is defined as .
Input Format
The first line contains two integers , representing the number of fish and the catching distance of the net.
The next lines each contain two integers, representing the coordinates of a fish.
Output Format
Output one line containing one integer, representing the minimum number of net casts.
3 4
0 0
2 3
-5 -3
2
Hint
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
For the remaining of the testdata, . The fish positions are generated using a random function and are uniformly distributed on the plane.
For all testdata, , and .
Translated by ChatGPT 5