#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,q;
    cin >> n >> q;
    long long intervali[n][2];
    int len = 0;
    long long l,r;
    cin >> l >> r;
    r += l-1;
    for ( int i = 1 ; i < n ; i++)
    {
        long long d,p;
        cin >> d >> p;
        if ( d >= l && d <= r ) r += p;
        else
        {
            intervali[len][0] = l;
            intervali[len++][1] = r;
            l = d;
            r = d + p - 1;
        }
    }
    intervali[len][0] = l;
    intervali[len++][1] = r;
    long long prefs[len + 1];
    prefs[0] = 0;
    //for ( int i = 0 ; i < len ; i++) cout << intervali[i][0] << " " << intervali[i][1] << endl;
    for ( int i = 1 ; i <= len ; i++) prefs[i] = prefs[i-1] + intervali[i-1][1] - intervali[i-1][0] + 1;
    while(q--)
    {
        long long x; cin >> x;
        if ( x > intervali[len-1][1]) cout << prefs[len] << endl;
        else if ( x < intervali[0][0]) cout << 0 << endl;
        else
        {
            l = 0, r = len;
            while(r - l > 1)
            {
                int  mid = (l + r) / 2;
                if ( x >= intervali[mid][0]) l = mid;
                else r = mid;
            }
            if ( x <= intervali[l][1]) cout << prefs[l] + x - intervali[l][0]  + 1 << endl;
            else cout << prefs[l+1] << endl;
        }
    }
	return 0;
}