Rosetta Problems

みさわさんの根付き木

https://hoj.hamako-ths.ed.jp/onlinejudge/problems/392