To 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
In 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.
The input contains several test cases. The very first line contains the number of cases that follow. Each test cases begin with the number of Cash Machines . Each of the next n lines contain the coordinates of one Cash Machine separated by a space.
No two points in one test case will coincide.
For each test case output lines. -th of them should contain the squared distance between the -th ATM from the input and its nearest neighbour.
Central European Programming Contest 2008