import bisect N, Q = map(int,input().split()) B = sorted([list(map(int,input().split())) for k in range(N)]) X = list(map(int,input().split())) K = [B[k][0]*B[k][1] for k in range(N)] T = [0]*N T[0] = K[0] for k in range(1,N): T[k] = T[k-1] + K[k] W = [B[k][1] for k in range(N)] U = [0]*N U[0] = W[0] for k in range(1,N): U[k] = U[k-1] + W[k] P = [B[k][0] for k in range(N)] def keisan(x): p = bisect.bisect_left(P,x) return abs(-T[p-1] + T[N-1]-T[p-1] + x*U[p-1] -x*(U[N-1]-U[p-1])) ans = [] for e in X: ans.append(keisan(e)) print(*ans,sep="\n")