Rosetta Problems

Seating Arrangement

https://atcoder.jp/contests/awc0046/tasks/awc0046_c