Rosetta Problems

展覧会 2 (Exhibition 2)

https://atcoder.jp/contests/joig2021-open/tasks/joig2021_d