UVA10605 Mines For Diamonds

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1546 [PDF](https://uva.onlinejudge.org/external/106/p10605.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10605/98bdff06b06bf5070de445e5ef081211075f1783.png)

Input Format

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

Output Format

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