Nibbles the Squirrel is participating in a hackathon and has decided to create a Virtual Roundtable as her project. The roundtable will be shaped like a nut, and Nibbles wants to minimize the bluntness of the table for it to be as round as possible.
Her computer screen has pixels, with pixel located at integer coordinates and has a distance of from the origin (i.e. can be calculated as ), let's define the bluntness of a roundtable as the absolute difference between the maximum and minimum of any pixel on the roundtable (i.e. ). Nibbles wants to choose a subset of her pixels to be part of her rountable such that the bluntness of the rountable does not exceed .
What is the maximum number of pixels that can be part of her roundtable while satisfying this constraint?
Constraints
In all test cases, , , .
Subtask 1 [20%]
Subtask 2 [30%]
Subtask 3 [50%]
No further constraints.
Input Specification
First line: (the number of pixels on Nibbles's computer screen), and (the maximum bluntness of the roundtable).
Next lines: , the coordinates of pixel .
Output Specification
One integer: the maximum number of pixels that can be part of Nibbles's roundtable.
Sample Input 1
9 1
1 0
0 1
-1 0
0 -1
1 1
-3 0
1 4
4 1
1 -3
Output for Sample Case 1
5
Explanation for Sample Case 1
For the outlined roundtable, the farthest point from the origin (E
) has a distance of , and the closest distance of any point to the origin is .
Therefore, the bluntness of the roundtable above is which does not exceed .
Comments