The hungry chess knight stays in the cell (x[1]
, y[1]
) of the chessboard of size n × n. He wants to get into the cell (x[2]
, y[2]
), where delicious chess grass grows. What is the least number of moves he has to do?
Contains five numbers: n, x[1]
, y[1]
, x[2]
, y[2]
(5 ≤ n ≤ 20, 1 ≤ x[1]
, y[1]
, x[2]
, y[2]
≤ n). The upper left cell of the board has coordinates (1, 1), the bottom right - (n, n).
Print the minimum number of moves to go from (x[1]
, y[1]
) to (x[2]
, y[2]
).