Pagini recente » Cod sursa (job #1372259) | Istoria paginii runda/itmarathon2015 | Monitorul de evaluare | Cod sursa (job #677069) | Cod sursa (job #149984)
Cod sursa(job #149984)
program p21;
var f,g:text;
a:array[1..2000000]of byte;
n,q,j,k,i,x:longint;
begin
assign(f,'ciur.in');reset(f);
assign(g,'ciur.out');rewrite(g);
readln(f,n);
a[1]:=1;
for i:=1 to n do
if a[i]=0 then for j:=i+1 to n do
begin
if j mod i =0 then begin
a[j]:=1;
x:=1;
end;
end;
for i:=n downto 1000 do
if a[i]=0 then begin
k:=k+1;
break;
end;
for j:=1 to n do
if a[j]=0 then q:=q+1;
if k>0 then for j:=1000 downto n do
begin
writeln(g,k);
if a[i]=0 then write(g,i,' ');
end
else begin
writeln(g,q);
for j:=1 to n do
if a[j]=0 then write(g,j,' ');
end;
close(g);
end.