Rosetta Problems

Seats in an Udon Restaurant

https://atcoder.jp/contests/awc0171/tasks/awc0171_b