Rosetta Problems

Attraction on Tree

https://atcoder.jp/contests/arc152/tasks/arc152_f