Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Think about the potential placements of the carpet in an optimal solution.
Can we use Prefix Sum and Binary Search to determine how many tiles are covered for a given placement?