Rosetta Problems

Tree Allocation

https://onlinejudge.u-aizu.ac.jp/problems/2398