% Define all needed functions here

g   = @(x)( [ ( 1+x(1)-prod(x)) ; (length(x)+1-ones(length(x)-1,1)*sum(x))] );
Dg  = @(x)( [ ([1 zeros(1,length(x)-1)]-prod( repmat(x,1,length(x))-diag(x)+diag(ones(1,length(x)))))
	      ; -ones(length(x)-1,length(x))] );
