Count Submatrices with Top-Left Element and Sum Less Than k
Every submatrix that contains the top-left cell is a prefix rectangle, so one prefix-sum table answers each corner.
Every submatrix that contains the top-left cell is a prefix rectangle, so one prefix-sum table answers each corner.