Pagini recente » Cod sursa (job #1909259) | Cod sursa (job #712485) | Cod sursa (job #306673) | Cod sursa (job #436595) | Cod sursa (job #774443)
Cod sursa(job #774443)
var f,g:text;
p,a,b,i,nr,d,nr1,c:longint;
begin
assign(f,'fact.in');reset(f);
assign(g,'fact.out');rewrite(g);
read(f,p);
if p=0 then write(g,1);
a:=p;
b:=p;
for i:= 1 to maxlongint do begin
if i mod 2=0 then begin
c:=i div 2;
nr:=nr+1;
end;
if (nr>=a)and(nr1>=b) then break;
if i mod 5=0 then begin
d:=i mod 5;
nr1:=nr1+1;
end;
if (nr>=a)and(nr1>=b) then break;
end;
write(g,i);
close(f);
close(g);
end.