find subarray and submatrix with largest sum