{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eThe course of Software Design and Development Practice is objectionable. ZLC is facing a serious problem .There are many points in K-dimensional space .Given a point. ZLC need to find out the closest m points. Euclidean distance is used as the distance metric between two points. The Euclidean distance between points p and q is the length of the line segment connecting them.In Cartesian coordinates, if p \u003d (p\u003csub\u003e1\u003c/sub\u003e, p\u003csub\u003e2\u003c/sub\u003e,..., p\u003csub\u003en\u003c/sub\u003e) and q \u003d (q\u003csub\u003e1\u003c/sub\u003e, q\u003csub\u003e2\u003c/sub\u003e,..., q\u003csub\u003en\u003c/sub\u003e) are two points in Euclidean n-space, then the distance from p to q, or from q to p is given by:\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/b895db34b23b91fe14d3deba7c864165?v\u003d1714349513\"\u003e\u003c/center\u003e\u003cbr\u003eCan you help him solve this problem?\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"In the first line of the text file .there are two non-negative integers n and K. They denote respectively: the number of points, 1 \u0026lt;\u003d n \u0026lt;\u003d 50000, and the number of Dimensions,1 \u0026lt;\u003d K \u0026lt;\u003d 5. In each of the following n lines there is written k integers, representing the coordinates of a point. This followed by a line with one positive integer t, representing the number of queries,1 \u0026lt;\u003d t \u0026lt;\u003d10000.each query contains two lines. The k integers in the first line represent the given point. In the second line, there is one integer m, the number of closest points you should find,1 \u0026lt;\u003d m \u0026lt;\u003d10. The absolute value of all the coordinates will not be more than 10000.\u003cbr\u003eThere are multiple test cases. Process to end of file."}},{"title":"Output","value":{"format":"HTML","content":"For each query, output m+1 lines:\u003cbr\u003eThe first line saying :”the closest m points are:” where m is the number of the points.\u003cbr\u003eThe following m lines representing m points ,in accordance with the order from near to far\u003cbr\u003eIt is guaranteed that the answer can only be formed in one ways. The distances from the given point to all the nearest m+1 points are different. That means input like this:\u003cbr\u003e2 2\u003cbr\u003e1 1\u003cbr\u003e3 3\u003cbr\u003e1\u003cbr\u003e2 2\u003cbr\u003e1\u003cbr\u003ewill not exist."}},{"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 1\r\n1 3\r\n3 4\r\n2\r\n2 3\r\n2\r\n2 3\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003ethe closest 2 points are:\r\n1 3\r\n3 4\r\nthe closest 1 points are:\r\n1 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}