def callMultiF(f,n,cache):
    """
    Try to get n unique results by calling f() multiple times
    >>> import random
    >>> random.seed(0)
    >>> callMultiF(lambda : random.randint(0,10), 9, set())
    [9, 8, 4, 2, 5, 3, 6, 10]
    >>> random.seed(0)
    >>> callMultiF(lambda : random.randint(0,10), 9, set([8,9,10]))
    [4, 2, 5, 3, 6, 7]
    """
    rs = []
    rs_s = set()
    if cache:
        for c in cache: rs_s.add(c)
        
    for _ in range(n):
        c = f()

        c_iter = 0
        while c in rs_s and c_iter < 3:
            c_iter += 1
            c = f()

        if c not in rs_s:
            rs_s.add(c)
            rs.append(c)

    assert len(rs) <= n
    return rs