UVA11553 Grid Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=27&page=show_problem&problem=2548 [PDF](https://uva.onlinejudge.org/external/115/p11553.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11553/c1059297a883ce37c0f3b8b467d90b0f5a0a746e.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11553/286656c80e50789275884e490c8540f04a9ade63.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11553/9a21349fba9a01930ceecb50b2c2b9065ccf38d8.png)