Rosetta Problems

Pile of Cards

https://atcoder.jp/contests/awc0129/tasks/awc0129_e