Rosetta Problems

Choosing Souvenirs

https://atcoder.jp/contests/awc0016/tasks/awc0016_c