UVA11118 Prisoners, Boxes and Pieces of Paper

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2059 [PDF](https://uva.onlinejudge.org/external/111/p11118.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11118/3bbcd09caa131f3dfd29677f7fe3af7e8eab60ee.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11118/361c252056bd63a384a9ec56ff9dd7c481d63c4e.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11118/5a7971f49c5ab340f679e50ac2411536c957c16b.png)