UVA829 Almost Balanced Trees

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=770 [PDF](https://uva.onlinejudge.org/external/8/p829.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA829/2a6196252da7d232bec682ae7478307db0bc3d2c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA829/2ce2ba4217cc29f956f832fbc78665b6c678e106.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA829/8317690f461e4d8320f31e84486743ea53c8e755.png)