Rosetta Problems

Forming an Adventurer Party

https://atcoder.jp/contests/awc0041/tasks/awc0041_d