UVA12476 Fun with Binary Tree

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3920 [PDF](https://uva.onlinejudge.org/external/124/p12476.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12476/0dff6bf975f25f934e91aadc9c65cbe851025bea.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12476/7837af90281e66c1fa4404f69423bcfdf3a17a9e.png)

Output Format

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