Subway Planning
Time limit1sMemory limit128 MB
Given points in the plane and a radius d, cover all points using the fewest rays from the origin, where a ray covers a point if some point on the ray is within distance d.
Problem
The government of a country is looking into building a subway system in its capital. For practical reasons, each subway line must start at the central station and then run in a straight line at some angle, extending as far as necessary. You have been hired to investigate whether such an approach is feasible.
Given the coordinates of the important places in the city, together with the maximum distance these places may be from a subway station (possibly the central station, which is already built), compute the minimum number of subway lines needed. You may assume that any number of subway stations can be built along a subway line.
The central station is located at coordinates . Each line is a ray starting at the origin, and a station may be placed at any point along it. An important place is served when the distance between it and some subway station is at most .

Figure 1: The figure above corresponds to the first data set in the example input.
Input
The first line of input contains an integer , the number of data sets that follow.
Each data set starts with two integers and (, ). is the number of important places in the city that must have a subway station nearby, and is the maximum distance allowed between an important place and a subway station.
Then follow lines, each containing two integers and (), the coordinates of an important place. The central station always has coordinates . All pairs of coordinates within a data set are distinct, and none is .
Output
For each data set, output a single integer on its own line: the minimum number of subway lines needed so that every important place is at distance at most from some subway station.