UVA10913 Walking on a Grid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1854 [PDF](https://uva.onlinejudge.org/external/109/p10913.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10913/43d648ffeb9813c1bcb1eb4476a829df8bced26c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10913/f4b054c5ca00f337f2e501dfdbe866d7156ebcff.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10913/97d237b73cd18aa06dfd77e6bbe0183fa459e8ed.png)