You inherited a haunted house. Its floor plan is an n×n square grid with no interior walls, and l lamps sit at fixed cells.
Each lamp lights either the row it stands in or the column it stands in, never both at once. The light reaches r cells in both directions along the chosen line, so a lamp that no exterior wall blocks lights as many as 2r+1 cells, counting its own.
If one cell is lit by two lamps that both light a row, or by two lamps that both light a column, the bright spot drives the ghosts away for good and your property loses value. A cell lit by one lamp that lights a row together with one lamp that lights a column causes no trouble.
Decide whether every lamp can be given a row or a column without driving the ghosts away.