Pagini recente » Cod sursa (job #1383630) | Cod sursa (job #1017718) | Cod sursa (job #1683570) | Cod sursa (job #2846963) | Cod sursa (job #171546)
Cod sursa(job #171546)
{****************}
{** Hai STEAUA **}
{****************}
{ghitza2008}
var i,n,x:longint;
s1:int64;
f,g:text;
procedure ghitza;
var z:int64;
begin
z:=x*2;
writeln(g,((z*(z+1))div 2)-s1);
end;
procedure Stefy ;
var j,h:longint;
a:array[1..600000] of byte;
begin
readln(f,x);
fillchar(a,2*x,0);
{for j:=1 to 2*x do
a[j]:=0;}
s1:=0;
j:=2;
while j<=x do
begin
if x mod j=0 then
if a[j]<>1 then begin
a[j]:=1;
h:=j;
s1:=s1+h;
while h<=2*x do
begin
if a[h]<>1 then begin
s1:=s1+h;
a[h]:=1;
end;
h:=h+j;
end;
end;
inc(j);
end;
ghitza;
end;
procedure sunt_cel_mai_tare;
begin
assign(f,'sum.in');reset(f);
readln(f,n);
assign(g,'sum.out'); rewrite(g);
for i:=1 to n do
begin
Stefy;
end;
end;
begin
sunt_cel_mai_tare;
close(f); close(g);
end.