Pagini recente » Cod sursa (job #897268) | Cod sursa (job #3284230) | Cod sursa (job #2893218) | Cod sursa (job #1716792) | Cod sursa (job #131952)
Cod sursa(job #131952)
{Pre/ONI Runda I/cls X}
var s:longint;
procedure citire;
var f:text;
g:boolean;
i,j,k,x,y:longint;
begin
assign(f,'pairs.in');
reset(f);
s:=0;
read(f,k);
i:=1;
repeat
for j:=1 to i do readln(f);
readln(f,x);
while eof(f)=false do
begin
readln(f,y);
g:=true;
for j:=2 to x do
if( x mod j=0) and (y mod j=0) then g:=false;
if (x mod y=0) or (y mod x=0) then g:=false;
if g=true then s:=s+1;
end;
reset(f);
i:=i+1;
until i=k;
close(f);
end;
procedure
scriere;
var f:text;
begin
assign(f,'pairs.out');
rewrite(f);
write(f,s);
close(f);
end;
BEGIN
citire;
scriere;
END.