Rosetta Problems

Collect Them All

https://atcoder.jp/contests/abc331/tasks/abc331_g