The hungry chess knight stays in the cell (
y1) of the chessboard of size n × n. He wants to get into the cell (
y2), where delicious chess grass grows. What is the least number of moves he has to do?
Contains five numbers: n,
y2 (5 ≤ n ≤ 20, 1 ≤
y2 ≤ 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 (
y1) to (
5 1 1 3 1