def find(matrix: list, x: int) -> bool:
    """
    Given a matrix and a number x, 
    judge whether x is in the matrix.
    The matrix is increased by rows from left to right and columns from up to down.
    
    Parameters
    ----------
    matrix: list
    x: int

    Returns
    --------
    out: bool

    """
    res = False
    row = 0
    m = len(matrix)
    col = len(matrix[0]) - 1
    while col > 0 and row < m:
        if matrix[row][col] > x:
            col -= 1
        elif matrix[row][col] < x:
            row += 1
        else:
            res = True
            break
    return res