#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N, Q = map(int, readline().split()) event = [] S = 0 coef = 0 for _ in range(N): x, w = map(int, readline().split()) event.append((x, w, 1)) S += x * w coef -= w X = map(int, read().split()) for i, x in enumerate(X): event.append((x, i, 2)) event.sort() answer = [0] * Q X = 0 for x, w, t in event: if t == 1: S += (x - X) * coef coef += 2 * w X = x else: i = w answer[i] = coef * (x - X) + S print('\n'.join(map(str, answer)))