Rosetta Problems

王国と M 種類の店

https://atcoder.jp/contests/tkppc3/tasks/tkppc3_i