def find_interval(x, partition):
    """ find_interval -> i
        "i" will be the index for which applies
        partition[i] < x < partition[i+1], if such an index exists.
        -1 otherwise
        """
    
    for i in range(0, len(partition)):
        if x < partition[i]:
            return i-1
    return -1