the maximal rectangle row by row.