Minimum Operations to Make All Grid Elements Equal
Raise every cell to a common target by stacking k by k square increments, placing each forced square at the first cell that still needs it.
Raise every cell to a common target by stacking k by k square increments, placing each forced square at the first cell that still needs it.