Rosetta Problems

LIDS

https://atcoder.jp/contests/agc059/tasks/agc059_f