UVA112 Tree Summing

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=48 [PDF](https://uva.onlinejudge.org/external/1/p112.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA112/ee9b47e479d70c22d369ddb505af41da0aebc120.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA112/7bc6b3b19fdaeb2394c8263c567feae640a649bc.png)