016 - Minimum Coins(★3)
制約が全探索をしろと言っているので、する
$ A,B の2枚についてだけ全探索すれば残り1枚は自動的に決まる
https://atcoder.jp/contests/typical90/submissions/59029774