UVA12966 Bishop's walk

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4845 [PDF](https://uva.onlinejudge.org/external/129/p12966.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12966/d364d268090f6a279b5a87f8ba0edcea3855b96a.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12966/3c6e7409d43df892f4104ff661d43dc9a4eb064e.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12966/38fb7452e4df0f4617b1522d89311951978ec9cd.png)