Pagini recente » Cod sursa (job #417742) | Cod sursa (job #2931621) | Cod sursa (job #1677558) | Cod sursa (job #3121273) | Cod sursa (job #30048)
Cod sursa(job #30048)
var sol,rt,vb1,min,i,j,n,max:longint;
begin
assign(input,'fractii.in');
assign(output,'fractii.out');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do
begin
for j:=1 to n do
begin
if i<j then begin min:=i; max:=j; end
else begin min:=j; max:=i; end;
inc(min);
vb1:=0;
repeat
dec(min);
if (i mod min=0) and (j mod min=0) and (min<>1) then begin vb1:=1; break; end;
until (min=max-min) or (min=1);
if vb1=0 then inc(sol);
end;
end;
write(sol);
close(input);
close(output);
end.