UVA103 Stacking Boxes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=39 [PDF](https://uva.onlinejudge.org/external/1/p103.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA103/ee890c0dfc9e9752860213b4441db1d6c7be9269.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA103/111e5070b37ca869234b8f7b47cea8af072c6bf3.png)

Output Format

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