#P14005. 「florr IO Round 1」棋盘游戏
「florr IO Round 1」棋盘游戏
Description
Little A's chessboard is an infinite plane Cartesian coordinate system, where each point can be represented as . 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 representing the current number of black pieces.
The next lines each contain two integers , representing the position of the -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 , representing the coordinates where Little A initially placed the black piece. It is guaranteed that there is a solution.
4
1 1
1 2
2 1
2 2
2 3
Hint
Sample Explanation
It can be achieved by one move from Little B:
Flip , and now the four points are black pieces. (This corresponds to the first shape in the problem description above.)
If you output , that is also correct, because it is possible that Little B flipped , which corresponds to the second shape in the problem description above.
Data Range
- For of the data, .
- For of the data, , .
Translated by ChatGPT 4.1
京公网安备 11011102002149号