Rosetta Problems

Arrange Your Balls

https://atcoder.jp/contests/agc059/tasks/agc059_b