Rosetta Problems

カードキー (Keycards)

https://atcoder.jp/contests/joisc2011/tasks/joisc2011_keycards