#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;
		int pos = distance(begin(a), upper_bound(all(a), x));
		int pos2 = distance(begin(b), upper_bound(all(b), x));
		ll ima_plazmu = x;
		if (pos == 0)
		{
			cout << 0 << endl;
			continue;
		}
		ima_plazmu -= a[0] - 1;
		ll ostatak = 0;
		int mn =  min(pos2, pos);
		if (pos <= pos2)
		{
			int i = 0;
			for (; i < mn - 1; i++)
			{
				if (a[i+1] > b[i])
					ima_plazmu -= (a[i+1] - b[i] - 1);
				else
					ostatak += (b[i] - a[i+1] + 1);
			}
			ima_plazmu -= (x - b[i]);
		}
		else
		{
			for (int i = 0; i < mn; i++)
			{
				{
					if (a[i+1] > b[i])
						ima_plazmu -= (a[i+1] - b[i] - 1);
					else
						ostatak += (b[i] - a[i+1] + 1);
				}
			}
		}
		cout << min(x, ima_plazmu + ostatak) << endl;
	}
}