function [C,B]=weight_DQ(N,x)
C=zeros(N,N);
for i=1:N
    for j=1:N
        if i~=j
            Pi=prod(x(i)-[x(1:i-1) x(i+1:N)]);
            Pj=prod(x(j)-[x(1:j-1) x(j+1:N)]);
            C(i,j)=Pi/(Pj*(x(i)-x(j)));
        else
            C(i,j)=sum(1./(x(i)-[x(1:i-1) x(i+1:N)]));
        end
    end
end
for i=1:N
    for j=1:N
        B(i,j)=0;
        for m=1:N
            B(i,j)=B(i,j)+C(i,m)*C(m,j);
        end
    end
end


