Rosetta Problems

Escape from the Ice Rink

https://atcoder.jp/contests/awc0083/tasks/awc0083_d