N,M=map(int,input().split()) P=list(map(int,input().split())) S=[] for _ in range(N): a,b=map(int,input().split()) S.append((a,b)) T=[] for j in range(M): c,d=map(int,input().split()) T.append((c,d)) T_set=set(T) X=0 for i in range(N): a,b=S[i] for j in range(M): c,d=T[j] for s,t in [(1,1),(1,-1),(-1,1),(-1,-1)]: u=c-s*a; v=d-t*b Y=0 for k in range(N): x,y=S[k] if (s*x+u, t*y+v) in T_set: Y+=P[k] if X