Pagini recente » Istoria paginii utilizator/maravalean | Atasamentele paginii ONIS 2014, Clasament Runda 2 | Diferente pentru rotatie-lexicografic-minima intre reviziile 2 si 38 | Rating Andrei Prahoveanu (BlueStrut) | Cod sursa (job #299086)
Cod sursa(job #299086)
var n,i,j,x,y,nr,r:longint;
begin
assign (input,'fractii.in');
reset (input);
assign (output,'fractii.out');
rewrite (output);
readln (n);
nr:=n;
for i:=2 to n do
for j:=1 to n do
begin
if j=1 then inc (nr)
else begin
x:=i;
y:=j;
while y<>0 do
begin
r:=x mod y;
x:=y;
y:=r;
end;
if x=1 then inc(nr);
end;
end;
writeln (nr);
end.