UVA12610 Attractive Grid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=602&page=show_problem&problem=4288 [PDF](https://uva.onlinejudge.org/external/126/p12610.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12610/9b8a30194c7a49b1303456f416eec5ae934b9de5.png)

Input Format

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

Output Format

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