Pagini recente » Cod sursa (job #2233865) | Cod sursa (job #2381848) | Cod sursa (job #2087627) | Cod sursa (job #1153992) | Cod sursa (job #25448)
Cod sursa(job #25448)
program puter1;
type rec=record
x,y,z:byte;
end;
var f,g:text;
a:array[0..100000] of rec;
x1,r,y1,j,z1,i,n,nr:longint;
begin
assign(f,'puteri.in'); reset(f);
assign(g,'puteri.out'); rewrite(g);
readln(f,n);
for i:=1 to n do read(f,a[i].x,a[i].y,a[i].z);
nr:=0;
for i:=2 to n do
for j:=1 to i-1 do begin
x1:=a[i].x+a[j].x;
y1:=a[i].y+a[j].y;
z1:=a[i].z+a[j].z;
while y1<>0 do begin
r:=x1 mod y1;
x1:=y1; y1:=r;
end;
while z1<>0 do begin
r:=x1 mod z1;
x1:=z1; z1:=r;
end;
if x1<>1 then inc(nr);
end;
writeln(g,nr);
close(g); close(f);
end.