Υǥ쥯ȥκ

(Y,0,[]).
(Y,N,[A|X]) :-
        del(Z = Y - A),
        M is N - 1,
        (Z,M,X).

del(X = [A|X] - A).
del([B|Y] = [B|X] - A) :-
        del(Y = X - A).

% del(A,[A|X],X).
% del(A,[B|X],[B|Y]) :-
%     del(A,X,Y).