Rosetta Problems

最古の遺跡 3 (Ruins 3)

https://atcoder.jp/contests/joisc2020/tasks/joisc2020_f