Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Note you can allocate at most two families in one row.
Greedily check if you can allocate seats for two families, one family or none.
Process only rows that appear in the input, for other rows you can always allocate seats for two families.