骑士的移动 Knight Moves
题意翻译
输入8*8的国际象棋棋盘上的2个格子(列:a~h,行:1~8),求马至少多少步从起点(键盘输入的第一个位置)跳到终点(键盘输入的第二个位置)。
感谢 @陶文祥 提供的翻译。
题目描述
[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=6&page=show_problem&problem=380
[PDF](https://uva.onlinejudge.org/external/4/p439.pdf)
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA439/49281f2a839995de267463a506fc7b04652bcf4a.png)
输入输出格式
输入格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA439/f986ca9c080d4c2fa5952f61f878eaafe27fdf4b.png)
输出格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA439/e3265edbb46489790ff00e32193564840a6de7fe.png)
输入输出样例
输入样例 #1
e2 e4
a1 b2
b2 c3
a1 h8
a1 h7
h8 a1
b1 c3
f6 f6
输出样例 #1
To get from e2 to e4 takes 2 knight moves.
To get from a1 to b2 takes 4 knight moves.
To get from b2 to c3 takes 2 knight moves.
To get from a1 to h8 takes 6 knight moves.
To get from a1 to h7 takes 5 knight moves.
To get from h8 to a1 takes 6 knight moves.
To get from b1 to c3 takes 1 knight moves.
To get from f6 to f6 takes 0 knight moves.