PROJECT EULER · #0364
Comfortable Distance
There are
- If there is any seat whose adjacent seat(s) are not occupied take such a seat.
- If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat.
- Otherwise take one of the remaining available seats.
The following figure shows

We can verify that
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.