#000283

BubbleKnight

There is a white knight on an endless chess board. Find the minimum number of moves needed by the knight in order to move from one given field to another.


InputFirst (and the only) line contains four integer numbers Kx , Ky , Tx , Ty , separated by a space, with -10^10 ≤ Kx , Ky , Tx , Ty ≤ 10^10. First two numbers represent the starting position of the knight, and the other two represent the position of the target field.

OutputThe output consists of one integer number, the minimal number of moves.


Input:
1 2 3 4
Output:
4

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.