UVA807 Towers of Powers

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=748 [PDF](https://uva.onlinejudge.org/external/8/p807.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA807/56240facf485338741075fe8521ebdabffb78e49.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA807/556923d4fa4d5e98500617fcdb1328ef4d826200.png)

Output Format

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