Rosetta Problems

Painting the Fence

https://atcoder.jp/contests/awc0089/tasks/awc0089_e