Time limit
2000 ms
Memory limit
262144 kB
Source
Codeforces Round #530 (Div. 1)
Tags
constructive algorithms dfs and similar greedy trees *1600
Editorial
Announcement (en) Tutorial (en)
Descriptions:

Sum in the tree

CodeForces - 1098A