~/algor $ cat problems/if-fil-necha-yurishda
Bishop moves
Medium
1000 ms
64 MB
45%
Two different squares of a chessboard are given: a bishop stands on $(x_{1}; y_{1})$. Determine the smallest number of moves the bishop needs to reach $(x_{2}; y_{2})$. If it cannot get there, print $-1$.
Input
One line with four integers: $x_{1}$, $y_{1}$, $x_{2}$ and $y_{2}$.
Output
One integer: the smallest number of moves, or $-1$.
Note
$1 \le x_{1}, y_{1}, x_{2}, y_{2} \le 8$
The squares are different.
Examples
Input #1
3 1 6 4
Output #1
1
Input #2
3 1 3 5
Output #2
2