UVA10161 Ant on a Chessboard

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1102 [PDF](https://uva.onlinejudge.org/external/101/p10161.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10161/0597f12de506dea07cc0b4ea19d42fcc7ebba9b3.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10161/874606c031f28a8050764886ed16b27a29dd02e9.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10161/05b959fb68913aa0e3d91e37d39fd44db5798647.png)