Rosetta Problems

Stable Arrangement of Cargo

https://atcoder.jp/contests/awc0106/tasks/awc0106_e