~/algor $ cat contests/round-8/H
H. Knight move
Two different squares of a chessboard and are given. A square is given as : is the column number (from left to right), is the row number (from bottom to top). A knight moves in an L shape: squares in one direction and square in the perpendicular direction. Check whether the statement is true: “the knight on square can move to square in one move”.
Input
One line with four positive integers: , , and .
Output
One integer: if the statement is true, otherwise .
Note
The squares are different.
Examples
4 4 5 6
1
4 4 6 6
0