#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);
	cin >> a[0] >> b[0];
	b[0] += a[0] - 1;
	forn1(i, n)
	{
		ll x, y; cin >> x >> y;
		if (x <= b[i-1])
			x = b[i-1] + 1;
		
		a[i] = x;
		b[i] = x + y - 1;
	}
	vector<ll> prefixSum(n+1);
	forn(i, n)
		prefixSum[i+1] = prefixSum[i] + (b[i] - a[i] + 1);
		
	while(q--)
	{
		ll x; cin >> x;
		auto itr = upper_bound(all(a), x);
		
		if (itr == begin(a))
		{
			cout << 0 << endl;
			continue;
		}
		itr--;
		
		int des = distance(begin(a), itr);
		ll sol = prefixSum[des];
		
		if (x <= b[des])
			sol += (x - a[des] + 1);
		else
			sol += b[des] - a[des] + 1;
		
		cout << sol << endl;
	}
}