Rosetta Problems

Distribution of Jewels

https://atcoder.jp/contests/awc0026/tasks/awc0026_b