UVA11194 Stone Grid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2135 [PDF](https://uva.onlinejudge.org/external/111/p11194.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11194/a8a84192dfa9747f7710bd13a4918a34ea8460d9.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11194/8460198423ba181e1e3d8551b6f3a0e90baf41fc.png)