Cod sursa(job #19229)
var t:text;
vekt:array[1..500000] of {longint;}double;
a,e:{longint;}double;
n,i:longint;
function match(h:longint):boolean;
var w,u,q:longint;
begin
w:=h+1;
u:=0;
q:=1;
while (w<n) and (u=0) do
begin
if vekt[w]<>vekt[q] then inc(u);
inc(w);
inc(q);
if w mod h=1 then q:=1;
end;
if u=0 then match:=true
else match:=false;
end;
begin
assign(t,'reguli.in');
reset(T);
read(t,n);
read(t,e);
for i:=2 to n do begin
read(t,a);
vekt[i-1]:=a-e;
e:=a;
end;
n:=n-1;
close(T);
i:=0;
repeat
inc(i);
until match(i);
assign(t,'reguli.out');
rewrite(T);
writeln(t,i);
for e:=1 to i do writeln(t,vekt[e]);
close(T);
end.