vara:array[1..500] of integer;i,k,n:integer;begink:=0; write('n= '); readln(n); for i:=1 to n do readln(a[i]); for i:=1 to n do k:=k+a[i]*a[i+1]; writeln(k);end.
var
a:array[1..500] of integer;
i,k,n:integer;
begin
k:=0;
write('n= ');
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
k:=k+a[i]*a[i+1];
writeln(k);
end.