{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003clink href\u003d\"css/light_oj.css\" rel\u003d\"stylesheet\" type\u003d\"text/css\" /\u003e\r\n\u003cp class\u003d\"MsoNormal\"\u003e\r\n\tSomewhere 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\r\n\u003cp align\u003d\"center\" class\u003d\"MsoNormal\" style\u003d\"text-align:center\"\u003e\r\n\t\u003cimg height\u003d\"205\" id\u003d\"Picture 1\" src\u003d\"http://lightoj.com/data/problems/desc/1154/f.gif\" width\u003d\"206\" /\u003e\u003c/p\u003e\r\n\u003cp align\u003d\"center\" class\u003d\"MsoNormal\" style\u003d\"text-align:center\"\u003e\r\n\tA sample layout of ice floes with 3 penguins on them\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNormal\"\u003e\r\n\tInput starts with an integer \u003cb\u003eT (\u003c/b\u003e\u003cb\u003e\u0026le; 25)\u003c/b\u003e, denoting the number of test cases.\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNormal\"\u003e\r\n\tEach case starts with the integer \u003cb\u003eN (1 \u0026le; N \u0026le; 100)\u003c/b\u003e and a floating-point number \u003cb\u003eD (0 \u0026le; D \u0026le; 10\u003csup\u003e5\u003c/sup\u003e)\u003c/b\u003e, denoting the number of ice pieces and the maximum distance a penguin can jump. After that there will be \u003cb\u003eN\u003c/b\u003e lines, each line containing \u003cb\u003ex\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e, n\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e and \u003cb\u003em\u003csub\u003ei\u003c/sub\u003e\u003c/b\u003e, denoting for each ice piece its \u003cb\u003eX\u003c/b\u003e and \u003cb\u003eY\u003c/b\u003e coordinate, the number of penguins on it and the maximum number of times a penguin can jump off this piece before it disappears \u003cb\u003e(-10000 \u0026le; x\u003csub\u003ei\u003c/sub\u003e, y\u003csub\u003ei\u003c/sub\u003e \u0026le; 10000, 0 \u0026le; n\u003csub\u003ei\u003c/sub\u003e \u0026le; 10, 1 \u0026le; m\u003csub\u003ei\u003c/sub\u003e \u0026le; 200)\u003c/b\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNormal\"\u003e\r\n\tFor each case of input, print the case number and a space-separated list of 0-based indices of the pieces on which all penguins can meet. If no such piece exists, output \u003cb\u003e-1\u003c/b\u003e.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e2\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e5 3.5\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e1 1 1 1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e2 3 0 1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e3 5 1 1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e5 1 1 1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e5 4 0 1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e3 1.1\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e-1 0 5 10\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e0 0 3 9\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003e2 0 1 1\u003c/span\u003e\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003eCase 1: 1 2 4\u003c/span\u003e\u003c/p\u003e\r\n\u003cp class\u003d\"MsoNoSpacing\"\u003e\r\n\t\u003cspan style\u003d\"font-family:\u0026quot;Courier New\u0026quot;\"\u003eCase 2: -1\u003c/span\u003e\u003c/p\u003e"}}]}