{"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\"\u003eTo help their clients deal with faulty Cash Machines, the board of The Planar Bank has decided to stick a label expressing sincere regret and sorrow of the bank about the failure on every ATM. The very same label would gently ask the customer to calmly head to the nearest Machine (that should hopefully\u003cbr\u003ework fine).\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eIn order to do so, a list of two-dimensional locations of all n ATMs has been prepared, and your task is to find for each of them the one closest with respect to the Euclidean distance.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains several test cases. The very first line contains the number of cases t (t \u0026lt;\u003d 15) that follow. Each test cases begin with the number of Cash Machines n (2 \u0026lt;\u003d n \u0026lt;\u003d 10^5). Each of the next n lines contain the coordinates of one Cash Machine x,y (0 \u0026lt;\u003d x,y \u0026lt;\u003d10^9) separated by a space. No two\u003cbr\u003epoints in one test case will coincide."}},{"title":"Output","value":{"format":"HTML","content":"For each test case output n lines. i-th of them should contain the squared distance between the i-th ATM from the input and its nearest neighbour."}},{"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\n10\r\n17 41\r\n0 34\r\n24 19\r\n8 28\r\n14 12\r\n45 5\r\n27 31\r\n41 11\r\n42 45\r\n36 27\r\n15\r\n0 0\r\n1 2\r\n2 3\r\n3 2\r\n4 0\r\n8 4\r\n7 4\r\n6 3\r\n6 1\r\n8 0\r\n11 0\r\n12 2\r\n13 1\r\n14 2\r\n15 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e200\r\n100\r\n149\r\n100\r\n149\r\n52\r\n97\r\n52\r\n360\r\n97\r\n5\r\n2\r\n2\r\n2\r\n5\r\n1\r\n1\r\n2\r\n4\r\n5\r\n5\r\n2\r\n2\r\n2\r\n5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}