Rosetta Problems

Balls of Three Colors

https://atcoder.jp/contests/arc128/tasks/arc128_b