Rosetta Problems

Distribution of Souvenirs

https://atcoder.jp/contests/awc0079/tasks/awc0079_d