Rosetta Problems

Magical Wallet

https://atcoder.jp/contests/ttpc2022/tasks/ttpc2022_b