{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eAfter a long lasting war on words, a war on arms finally breaks out between littleken’s and KnuthOcean’s kingdoms. A sudden and violent assault by KnuthOcean’s force has rendered a total failure of littleken’s command network. A provisional network must be built immediately. littleken orders snoopy to take charge of the project.\u003c/p\u003e\u003cp\u003eWith the situation studied to every detail, snoopy believes that the most urgent point is to enable littenken’s commands to reach every disconnected node in the destroyed network and decides on a plan to build a unidirectional communication network. The nodes are distributed on a plane. If littleken’s commands are to be able to be delivered directly from a node A to another node B, a wire will have to be built along the straight line segment connecting the two nodes. Since it’s in wartime, not between all pairs of nodes can wires be built. snoopy wants the plan to require the shortest total length of wires so that the construction can be done very soon.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe input contains several test cases. Each test case starts with a line containing two integer \u003ci\u003eN\u003c/i\u003e (\u003ci\u003eN\u003c/i\u003e ≤ 100), the number of nodes in the destroyed network, and \u003ci\u003eM\u003c/i\u003e (\u003ci\u003eM\u003c/i\u003e ≤ 10\u003csup\u003e4\u003c/sup\u003e), the number of pairs of nodes between which a wire can be built. The next \u003ci\u003eN\u003c/i\u003e lines each contain an ordered pair \u003ci\u003ex\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003ey\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, giving the Cartesian coordinates of the nodes. Then follow \u003ci\u003eM\u003c/i\u003e lines each containing two integers \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e between 1 and \u003ci\u003eN\u003c/i\u003e (inclusive) meaning a wire can be built between node \u003ci\u003ei\u003c/i\u003e and node \u003ci\u003ej\u003c/i\u003e for unidirectional command delivery from the former to the latter. littleken’s headquarter is always located at node 1. Process to end of file.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eFor each test case, output exactly one line containing the shortest total length of wires to two digits past the decimal point. In the cases that such a network does not exist, just output ‘\u003ccode\u003epoor snoopy\u003c/code\u003e’.\u003c/p\u003e\u003c/span\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\u003e4 6\r\n0 6\r\n4 6\r\n0 0\r\n7 20\r\n1 2\r\n1 3\r\n2 3\r\n3 4\r\n3 1\r\n3 2\r\n4 3\r\n0 0\r\n1 0\r\n0 1\r\n1 2\r\n1 3\r\n4 1\r\n2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e31.19\r\npoor snoopy\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}