UVA10406 Cutting tabletops

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1347 [PDF](https://uva.onlinejudge.org/external/104/p10406.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10406/507f3082ced300321484d877b8ac5f1dac51dd8b.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10406/916914410ada3d3a7440c35c4b7eb2cbf715e652.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10406/4df98e1da4d9a86e1e77d8390f9bfae595d831e6.png)