Rosetta Problems

Level K Terms

https://atcoder.jp/contests/agc071/tasks/agc071_d