#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 x1,y1x_1, y_1 and x2,y2x_2, y_2. They must move from x1,y1x_1, y_1 and x2,y2x_2, y_2 to (1,1)(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 xx or yy coordinate satisfies 0\le 0. Any (x,y)(x, y) that satisfies this constraint is reachable.

Input Format

The first line contains two integers x1,y1x_1, y_1.

The second line contains two integers x2,y2x_2, y_2.

Output Format

The first line contains one integer, the number of steps for the black knight to reach (1,1)(1, 1).

The second line contains one integer, the number of steps for the white knight to reach (1,1)(1, 1).

12 16
18 10
8 
9

Hint

Constraints

For 100%100\% of the testdata, 1x1,y1,x2,y2201 \le x_1, y_1, x_2, y_2 \le 20.

Translated by ChatGPT 5