Cod sursa(job #253675)
type coord=record
x,y:longint;
end;
var v:array [1..100000] of coord;
n,m,i,r,x,y,nr,j:longint;
f,g:text;
procedure citire;
var i:longint;
begin
readln(f,n,m);
for i:=1 to n do readln(f,v[i].x,v[i].y);
end;
function obiectiv(a,b:longint):integer;
var d:longint;
begin
d:=abs(a-x)+abs(b-y);
if d<=r then obiectiv:=1
else obiectiv:=0;
end;
begin
assign(f,'grendizer.in');
assign(g,'grendizer.out');
reset(f);
rewrite(g);
citire;
for i:=1 to m do
begin
readln(f,x,y,r);
nr:=0;
for j:=1 to n do nr:=nr+obiectiv(v[j].x,v[j].y);
writeln(g,nr);
end;
close(f);
close(g);
end.