#P10459. Minimum Distance Between Agents and Power Stations
Minimum Distance Between Agents and Power Stations
Minimum Distance Between Agents and Power Stations
The Empire's defense system relies on charging from $N$ nuclear power stations. By deploying $N$ special agents, the Union aims to disable the system by attacking one of these power stations. However, the agents have landed at unexpected positions. General Arthur now wants to know the minimum distance between any agent and any power station. Given the coordinates of the power stations and the agents in a 2D plane, compute the minimum Euclidean distance between an agent and a power station. The Euclidean distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is given by $\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$.
inputFormat
The first line contains an integer $N$, representing the number of nuclear power stations and special agents.
The next $N$ lines each contain two space-separated integers, representing the coordinates of the power stations in the 2D plane.
The following $N$ lines each contain two space-separated integers, representing the coordinates of the special agents in the 2D plane.
outputFormat
Output a single floating-point number: the minimum Euclidean distance between any agent and any power station, rounded to 6 decimal places.
sample
3
0 0
10 10
20 20
5 5
15 15
25 25
7.071068
</p>