Rosetta Problems

Restore the Tree

https://atcoder.jp/contests/nikkei2019-qual/tasks/nikkei2019_qual_d