Weight the Tree

Problem Name:
Weight the Tree
Site:CodeForces
Links:
Tags:
Problem setters: