#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forn1(i, n) for (int i = 1; i < int(n); i++)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define MOD 1000000007 // 998244353
#define FIO                \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);

int main()
{
	FIO
	ll n, q; cin >> n >> q;
	vector<ll> a(n), b(n);
	forn(i, n)
	{
		cin >> a[i] >> b[i];
		b[i] += a[i] - 1;
	}
		
	sort(all(b));
	while(q--)
	{
		ll x; cin >> x;
		ll score = 0;
		for (int i = 0; i < n && a[i] <= x; i++)
		{
			score += min(b[i], x) - a[i] + 1;
			if (b[i] >= x)
				break;
		}
		cout << score << endl;
	}
}