Rosetta Problems

古代の機械 (Ancient Machine)

https://atcoder.jp/contests/joisc2021/tasks/joisc2021_h