#P1227. Find the Symmetry Center

    ID: 14378 Type: Default 1000ms 256MiB

Find the Symmetry Center

Find the Symmetry Center

During the summit, bodyguards are positioned in various directions around a protected person. The optimal position for the protected person is at the symmetry center of the bodyguards' positions. Formally, given a set of N points, the symmetry center S is defined such that for every point A in the set, its reflection A' with respect to S is also in the set. In other words, if S is the midpoint of the segment AA' for every point A in the configuration, then the set is symmetric about S.

Your task is to find the symmetry center S given the positions of the bodyguards. It is guaranteed that the given points have a symmetry center. Note that S = (\bar{x}, \bar{y}) can be computed as:

$$S = \left( \frac{1}{N}\sum_{i=1}^{N}x_i, \frac{1}{N}\sum_{i=1}^{N}y_i \right) $$

Output the coordinates of S separated by a space. The coordinates may be non-integer values.

inputFormat

The first line contains an integer N representing the number of bodyguards. Each of the following N lines contains two numbers, which represent the x and y coordinates of a bodyguard's position. The coordinates can be integers or real numbers.

outputFormat

Output the x and y coordinates of the symmetry center S, separated by a space.

sample

4
0 0
0 2
2 0
2 2
1 1