P1747 A Very Strange Game
Background
"The Story of Love and Sorrow III · shopping", entertainment chapter.
Let’s change the pace with an easy problem.
Description
Aiyuchou dashen was bored on the bus and started playing on the phone. A strange game caught Aiyuchou dashen’s eye: *** (the game’s name is mosaicked). The game is similar to chess, but there is only one black knight and one white knight, located at points $x_1, y_1$ and $x_2, y_2$. They must move from $x_1, y_1$ and $x_2, y_2$ to $(1, 1)$. This game differs from ordinary chess in that a knight can move in an L shape (“ma”) and can also move like an “elephant” (“xiang”) in Chinese chess, i.e., two squares diagonally.
Note that you cannot move to any position where the $x$ or $y$ coordinate satisfies $\le 0$. Any $(x, y)$ that satisfies this constraint is reachable.
Input Format
The first line contains two integers $x_1, y_1$.
The second line contains two integers $x_2, y_2$.
Output Format
The first line contains one integer, the number of steps for the black knight to reach $(1, 1)$.
The second line contains one integer, the number of steps for the white knight to reach $(1, 1)$.
Explanation/Hint
### Constraints
For $100\%$ of the testdata, $1 \le x_1, y_1, x_2, y_2 \le 20$.
Translated by ChatGPT 5