UVA946 A Pile of Boxes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=887 [PDF](https://uva.onlinejudge.org/external/9/p946.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA946/99eac4677fe584711d2a8707c857691877fa5648.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA946/9516b31b5fd3a844d73ac5dae0ec634c75e1dab1.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA946/42022c16cfff0b73eda8985875db7d208a4567f4.png)