UVA277 Cabinets

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=213 [PDF](https://uva.onlinejudge.org/external/2/p277.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA277/950fd60f024b9c5b7b4201e79c4dabc839eb8183.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA277/1cc7e7e165f358252bb906f727ca18ec3b636133.png)

Output Format

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