Rosetta Problems

Don't Leave the Spice(★5)

https://atcoder.jp/contests/typical90/tasks/typical90_ak