#C559. Minimum Euclidean Distance Among Warriors
Minimum Euclidean Distance Among Warriors
Minimum Euclidean Distance Among Warriors
In this problem, you are given T test cases. For each test case, you will be provided with N warriors each with x and y coordinates on a two-dimensional plane. Your task is to calculate the minimum Euclidean distance between any two distinct warriors for each test case.
The Euclidean distance between two points \((x_1, y_1)\) and \((x_2, y_2)\) is given by the formula:
\(d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\)
Output the minimum distance for each test case rounded to 6 decimal places.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains a single integer T, the number of test cases.
- For each test case:
- The first line contains an integer N, the number of warriors.
- Then follow N lines, each containing two integers representing the coordinates x and y of a warrior.
outputFormat
For each test case, output a single line containing the minimum Euclidean distance rounded to 6 decimal places. The output should be written to standard output (stdout).
## sample2
4
1 2
3 4
-1 -1
2 3
3
0 0
1 1
3 3
1.414214
1.414214
</p>