• + 0 comments

    from itertools import product

    def get_coordinates(x: int, y: int, z: int, n: int) -> list:

    result = product(range(x+1), range(y+1), range(z+1))
    return [list(v) for v in filter(lambda x: sum(x) != n, result)]
    

    if name == 'main':

    x = int(input())
    y = int(input())
    z = int(input())
    n = int(input())
    
    print(get_coordinates(x, y, z, n))