Rosetta Problems

Repainting the Fence

https://atcoder.jp/contests/awc0053/tasks/awc0053_d