N,M=map(int,input().split())
S=[]
L=[]
for i in range(N):
	S.append(list(map(int,input().split())))
for i in range(M):
	L.append(list(map(int,input().split())))
for i in range(N):
	tmp=0
	for j in range(M):
		tmp+=abs(S[i][0]-L[j][0])+abs(S[i][1]-L[j][1])
	if min(tmp//M-tmp/M,tmp//M+1-tmp/M)==tmp//M-tmp/M:
		print(tmp//M)
	else:
		print(tmp//M+1)