P14005 Board Game

Background

已确认 SPJ 无误,数据强度足够,请选手不要发表无意义言论。

Description

Little A's chessboard is an infinite plane Cartesian coordinate system, where each point can be represented as $(x, y)$. Initially, **there is exactly one black piece**, and all other pieces are white. Each time, Little B can flip the colors of five points in one of the following two shapes: $$ \begin{aligned} &\huge\tt\ \ O\\ &\huge\tt OO\\ &\huge\tt OO \end{aligned} $$ $$ \begin{aligned} &\huge\tt O\\ &\huge\tt OO\\ &\huge\tt OO \end{aligned} $$ Little A wants to know where the black piece he placed at the beginning could be. Can you help him? **If there are multiple answers, output any one of them.**

Input Format

The first line contains an integer $n$ representing the current number of black pieces. The next $n$ lines each contain two integers $x_i, y_i$, representing the position of the $i$-th black piece. It is guaranteed that these positions are all distinct.

Output Format

Output one line with two integers, each with absolute value not exceeding $10^9$, representing the coordinates where Little A initially placed the black piece. **It is guaranteed that there is a solution.**

Explanation/Hint

### Sample Explanation It can be achieved by one move from Little B: Flip $(2,3), (2,2), (1,2), (2,1), (1,1)$, and now the four points $(2,2), (1,2), (2,1), (1,1)$ are black pieces. (This corresponds to the first shape in the **problem description** above.) If you output $(3,2)$, that is also correct, because it is possible that Little B flipped $(2,3), (2,2), (1,2), (2,1), (1,1)$, which corresponds to the second shape in the **problem description** above. ### Data Range - For $30\%$ of the data, $n=1$. - For $100\%$ of the data, $1 \le n \le 10^5$, $|x_i|, |y_i| \le 10^9$. Translated by ChatGPT 4.1