Rosetta Problems

AtCoDeer and Paint Cans

https://atcoder.jp/contests/abc046/tasks/abc046_a