Rosetta Problems

Cats Going Straight II

https://onlinejudge.u-aizu.ac.jp/problems/0273