Rosetta Problems

Amusement Park Attraction

https://atcoder.jp/contests/awc0144/tasks/awc0144_a