#C8084. Optimal Delivery Center Location

    ID: 52027 Type: Default 1000ms 256MiB

Optimal Delivery Center Location

Optimal Delivery Center Location

Given a list of points representing the locations of houses on a 2D plane, the task is to determine the best location for a delivery center from among the provided points. The best location is defined as the point that minimizes the maximum Euclidean distance to any other point. In other words, if a candidate point is selected as the delivery center, its delivery range is the maximum distance from that point to any other point.

The Euclidean distance between two points \( (x_1, y_1) \) and \( (x_2, y_2) \) is given by the formula:

$$ d = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} $$

If multiple points yield the same minimal maximum distance, choose the one that appears first in the input order.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer \( n \) representing the number of points.
  • Each of the next \( n \) lines contains two space-separated integers \( x \) and \( y \) representing the coordinates of a point.

outputFormat

Output to standard output (stdout) a single line containing two integers separated by a space, which represent the coordinates of the optimal delivery center.

## sample
5
0 0
4 0
2 3
3 3
1 4
2 3

</p>