#P1747. 好奇怪的游戏
好奇怪的游戏
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 and . They must move from and to . 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 or coordinate satisfies . Any that satisfies this constraint is reachable.
Input Format
The first line contains two integers .
The second line contains two integers .
Output Format
The first line contains one integer, the number of steps for the black knight to reach .
The second line contains one integer, the number of steps for the white knight to reach .
12 16
18 10
8
9
Hint
Constraints
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号