Pagini recente » Cod sursa (job #9244) | Cod sursa (job #574844) | Cod sursa (job #3177545) | Cod sursa (job #993917) | Cod sursa (job #146964)
Cod sursa(job #146964)
var v:array [1..2000000] of byte;
n,i,j,k:longint;
begin
assign(input,'ciur.in'); reset(input);
assign(output,'ciur.out'); rewrite(output);
readln(n);
for i:=2 to n do
if v[i]=0 then begin
inc(k);
for j:=2 to n div i do v[i*j]:=1;
end;
writeln(k); j:=0; k:=k-1000;
for i:=2 to n do
if v[i]=0 then begin
inc(j);
if j>k then write(i,' ');
end;
close(input); close(output);
end.