Rosetta Problems

Grid Card Game

https://atcoder.jp/contests/abc259/tasks/abc259_g