x=input('Upisite X \n'); for n=1:2000; S=(n/2)*(x+x*n); if S>2000 disp('Najveci n je:') disp(n-1) break end end