UVA10351 Cutting Diamonds

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1292 [PDF](https://uva.onlinejudge.org/external/103/p10351.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10351/eb8147b5b51d488a7dda317d6bcbc9059e19fccb.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10351/6b90e428c97f287e989262c2ccf5517cdbbab388.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10351/618328999b698fb8f4ddb510d3bbda2227c78e6d.png)