function y=rosenbrock(x,k)
y = 0;
for j=1:k
    y = y + 100*(x(2*j)-x(2*j-1)^2)^2+(1-x(2*j-1))^2;
end
