{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSomewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would like to get together, all on the same floe. The penguins do not want to get wet, so they have use their limited jump distance to get together by jumping from piece to piece. However, temperatures have been high lately, and the floes are showing cracks, and they get damaged further by the force needed to jump to another floe. Fortunately the penguins are real experts on cracking ice floes, and know exactly how many times a penguin can jump off each floe before it disintegrates and disappears. Landing on an ice floe does not damage it. You have to help the penguins find all floes where they can meet.\u003c/p\u003e\u003cdiv align\u003d\"center\"\u003e\u003cimg src\u003d\"CDN_BASE_URL/1a7e8c7798da11d5f84d590a2e10f41f?v\u003d1726142214\"\u003e\u003c/div\u003e\u003cp align\u003d\"center\"\u003eA sample layout of ice floes with 3 penguins on them.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eOn the first line one positive number: the number of testcases, at most 100. After that per testcase:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cp\u003eOne line with the integer \u003ci\u003eN\u003c/i\u003e (1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 100) and a floating-point number \u003ci\u003eD\u003c/i\u003e (0 ≤ \u003ci\u003eD\u003c/i\u003e ≤ \u003cnobr\u003e100 000\u003c/nobr\u003e), denoting the number of ice pieces and the maximum distance a penguin can jump.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003ci\u003eN\u003c/i\u003e lines, each line containing \u003ci\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ey\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003en\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003em\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, denoting for each ice piece its \u003ci\u003eX\u003c/i\u003e and \u003ci\u003eY\u003c/i\u003e coordinate, the number of penguins on it and the maximum number of times a penguin can jump off this piece before it disappears (\u003cnobr\u003e−10 000\u003c/nobr\u003e ≤ \u003ci\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ey\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ \u003cnobr\u003e10 000\u003c/nobr\u003e, 0 ≤ \u003ci\u003en\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 10, 1 ≤ \u003ci\u003em\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 200).\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePer testcase:\u003c/p\u003e\u003cul\u003e\u003cli\u003eOne line containing a space-separated list of 0-based indices of the pieces on which all penguins can meet. If no such piece exists, output a line with the single number −1.\u003c/li\u003e\u003c/ul\u003e"}},{"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\u003e2\r\n5 3.5\r\n1 1 1 1\r\n2 3 0 1\r\n3 5 1 1\r\n5 1 1 1\r\n5 4 0 1\r\n3 1.1\r\n-1 0 5 10\r\n0 0 3 9\r\n2 0 1 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 4\r\n-1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}