UVA11644 Pyragrid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2691 [PDF](https://uva.onlinejudge.org/external/116/p11644.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11644/6454d6262e65786f0e1cc678dd8d795a772da8a0.png)

Input Format

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

Output Format

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