S:=X[1]+X[N]; for k:=1 to N do X[k]:=X[k]+X[k]+S;
S:=X[1]*X[N]; for k:=1 to N do begin X[k]:=2*X[k]+S; for i:=1 to 3 do S:=S*2; end;
S:=X[1]+X[N]+3; for k:=1 to N do for m:=1 to N do X[k]:=X[k]+S;
S:=X[1]+X[N]; for k:=1 to N do for m:=1 to 5 do X[k]:=X[k]+S;
S:=X[1]+X[N]; for k:=1 to N do for m:=1 to k do X[k]:=X[k]+X[m]+S;
S:=X[1]+X[N]; for k:=1 to N do for m:=1 to N do for q:=1 to k do X[k]:=X[k]+X[q]+S;
function Rec(N: integer): integer; begin Rec:=0; if N > 3 then Rec:=Rec+Rec(N-1)+2*Rec(N-2); end;
S:=X[1]+X[N]; for k:=1 to N do for m:=1 to 2*N*N do X[k]:=X[k]+X[m]+S;
L:=1; R:=N+1; while L<R-1 do begin c:=L+div(R-L,2) if R < X[c] then R:=c else L:=c; end;
k:=0; for i:=1 to N do if X[i] = R then begin k:=i; break; end;
for i:=1 to N-1 do for j:=N-1 downto i do if A[j]>A[j+1] then Swap(A[j], A[j+1]);