#C6494. Drone Vertical Distance Optimization
Drone Vertical Distance Optimization
Drone Vertical Distance Optimization
You are given several test cases. In each test case you are given n points in the plane (each having an x and y coordinate). The task is to determine the minimum maximum vertical distance that a drone would need to cover, defined by the difference between the highest and lowest y-coordinate among the points. Mathematically, for a set of points with y-coordinates \(y_1, y_2, \dots, y_n\), you need to compute:
[ d = y_{\max} - y_{\min} ]
where \(y_{\max}\) and \(y_{\min}\) are the maximum and minimum y-coordinates in that test case, respectively.
For each test case, output the value of \(d\) formatted to two decimal places. The input is given via stdin and the output must be written to stdout.
inputFormat
The first line contains an integer T representing the number of test cases. For each test case:
- The first line contains an integer n denoting the number of points.
- The next n lines each contain two integers separated by a space, representing the x and y coordinates of a point.
outputFormat
For each test case, output a single line containing the minimum maximum vertical distance (i.e. \(y_{\max} - y_{\min}\)) formatted to two decimal places.
## sample3
4
0 0
2 1
3 -1
5 3
3
1 1
-1 3
2 -2
5
-5 -5
-5 5
5 -5
5 5
0 0
4.00
5.00
10.00
</p>