UVA11116 Babel Towers

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11116/26d0807695cd11bb38dffbdabbb7f611ec41a514.png)

Output Format

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