def _row_sum(matrix, m1, n1, m2, n2):
    """Computes the sum of the first row of the submatrix starting at (m1, n1)
    and ending at (m2, n2).

    `m2` must be greater than `m1` and `n2` must be greater than `n1`.

    """
    return sum(matrix[m1:m2, n1:n2][0])
