#C2941. Optimal Medic Position
Optimal Medic Position
Optimal Medic Position
You are given N checkpoints on a 2D plane with coordinates \( (x_i, y_i) \). Your task is to determine the optimal position \( (x, y) \) for the medic so that the maximum Euclidean distance from this point to any checkpoint is minimized. In other words, you need to minimize the function
\( f(x,y) = \max_{1 \leq i \leq N} \sqrt{(x-x_i)^2+(y-y_i)^2} \)
This optimal position is the center of the minimum enclosing circle that covers all the given checkpoints.
inputFormat
The input is read from standard input (stdin) and consists of:
- An integer \(N\) representing the number of checkpoints.
- \(N\) lines follow, each containing two space-separated integers \(x\) and \(y\) — the coordinates of a checkpoint.
outputFormat
Output to standard output (stdout) two numbers: the \(x\) and \(y\) coordinates of the optimal medic position, printed with 10 decimal places and separated by a space.
## sample4
0 0
10 0
10 10
0 10
5.0000000000 5.0000000000
</p>