{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the sea can be covered by a radius installation, if the distance between them is at most d.\r\u003cbr\u003e\r\u003cbr\u003eWe use Cartesian coordinate system, defining the coasting is the x-axis. The sea side is above x-axis, and the land side below. Given the position of each island in the sea, and given the distance of the coverage of the radar installation, your task is to write a program to find the minimal number of radar installations to cover all the islands. Note that the position of an island is represented by its x-y coordinates.\r\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/f6ffe515205096387436c13c7449b0ed?v\u003d1714186803\"\u003e\r\u003cbr\u003eFigure A Sample Input of Radar Installations\u003c/center\u003e\r\u003cbr\u003e\r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of several test cases. The first line of each case contains two integers n (1\u0026lt;\u003dn\u0026lt;\u003d1000) and d, where n is the number of islands in the sea and d is the distance of coverage of the radar installation. This is followed by n lines each containing two integers representing the coordinate of the position of each island. Then a blank line follows to separate the cases.\r\u003cbr\u003e\r\u003cbr\u003eThe input is terminated by a line containing pair of zeros\r\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case output one line consisting of the test case number followed by the minimal number of radar installations needed. \"-1\" installation means no solution for that case."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 2\r\n1 2\r\n-3 1\r\n2 1\r\n\r\n1 2\r\n0 2\r\n\r\n0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2\r\nCase 2: 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}