Pagini recente » Cod sursa (job #2547408) | Cod sursa (job #2547373) | Cod sursa (job #2650579) | Cod sursa (job #1391086) | Cod sursa (job #253972)
Cod sursa(job #253972)
var f,g:text;
i,j,m,n,r,a,b,num,xx,yy:longint;
x,y:array[1..100000] of integer;
begin
assign (f,'grendizer.in');reset(f);
assign (g,'grendizer.out');rewrite (g);
readln (f,n,m);
if (n<1000) and (m<1000) then begin
for i:=1 to n do
readln (f,x[i],y[i]);
for i:=1 to m do begin
readln (f,a,b,r);
num:=0;
for j:=1 to n do begin
xx:=abs(a-x[j]);
yy:=abs(b-y[j]);
if (xx+yy)=r then inc(num);
end;
writeln (g,num);
end;
end;
close(f);close(g);
end.