UVA10426 Knights' Nightmare

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1367 [PDF](https://uva.onlinejudge.org/external/104/p10426.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10426/fd3659ae6b46026c8ebb6ecf3e844ad4de3c0f09.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10426/787ca385c77dee4e92d0a6083c3faba0bf28ecf0.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10426/10aee4d15d7444c9fad5f06817abcba34f5162c1.png)