ARC111 B Reversible Cards
Chokudai SpeedRun 002 K 種類数β
の下位互換(座標圧縮が必要ない).
実装例:
https://atcoder.jp/contests/arc111/submissions/19300564