~/algor $ cat problems/if/how-many-moves-for-the-bishop
How many moves for the bishop?
Medium
1000 ms
64 MB
45%
Two different squares of a chessboard are given: a bishop stands on . Determine the smallest number of moves the bishop needs to reach . If it cannot get there, print .
Input
One line with four integers: , , and .
Output
One integer: the smallest number of moves, or .
Note
The squares are different.
Examples
Input #1
3 1 6 4
Output #1
1
Input #2
3 1 3 5
Output #2
2