Radar Installation
InterviewTime limit1sMemory limit128 MB
Each island on the sea side of a line must be covered by radars of reach d placed on the line, so find the minimum number of placements or report -1 if some island is unreachable.
Problem
Assume the coastline is an infinitely long straight line. Land lies on one side of the coastline and sea on the other. Each island is a single point located on the sea side. A radar installation placed on the coastline can cover a distance of , so an island in the sea is covered by a radar if the distance between them is at most .
We use a Cartesian coordinate system in which the coastline is the x-axis. The sea side is above the x-axis (positive ) and the land side is below it. Given the position of each island in the sea and the coverage distance of a radar, write a program to find the minimum number of radar installations needed to cover all islands. Each island's position is given by its x- and y-coordinates.

Figure A. A sample input of radar installations
Input
The input consists of several test cases. The first line of each case contains two integers () and , where is the number of islands in the sea and is the coverage distance of a radar. This is followed by lines, each containing two integers that give the coordinates of one island. A blank line separates consecutive cases.
The input is terminated by a line containing a pair of zeros (0 0).
Output
For each test case, print one line in the form Case x: y, where x is the test case number (starting from 1) and y is the minimum number of radar installations needed. If not all islands can be covered, print -1 in place of y.