#P3421. [POI 2005] SKO-Knights
[POI 2005] SKO-Knights
Description
A knight moves on an infinite chessboard. Each move it can perform is described by a pair of integers , meaning the knight can move from to or to . Each knight has a set of such move descriptions, representing the moves it can perform. We assume that all positions reachable by a knight starting from are not collinear.
We say two knights are equivalent if they can reach exactly the same set of coordinates from . (Note that the same knight may reach those squares using different sequences of moves.) It can be shown that for every knight there exists an equivalent knight whose moves can be described by only two pairs of integers.
Your task is to read a set of move descriptions for a knight, determine two pairs of integers that describe an equivalent knight, and output these two pairs.
Input Format
The first line contains an integer (), the number of move pairs.
Each of the next lines contains a pair of integers and separated by a space, where and .
Output Format
Output two lines.
The first line contains two integers and separated by a space.
The second line contains two integers and separated by a space.
These integers must satisfy , and the two output pairs must describe a knight equivalent to the knight described in the input.
3
24 28
15 50
12 21
3 0
0 1
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号