Problem 3027 · Hard

Find the Number of Ways to Place People II

Sort the points by column, then sweep each upper-left point rightward, counting a lower-right point when no earlier point blocks its fence.

Open the interactive visualisation