#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define pii pair<ll,ll>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll N, Q, dan;
    cin >> N >> Q;
    vector <ll> D(N + 1), P(N + 1), sum(N + 1);
    vector <pii> ranges;
    for(int i = 1; i <= N; i++) cin >> D[i] >> P[i];
    ll L = D[1];
    ll R = D[1] + P[1] - 1;
    for(int i = 2; i <= N; i++)
    {
        if(D[i] <= R) R += P[i];
        else {ranges.push_back({L, R}); L = D[i]; R = D[i] + P[i] - 1;}
    }
    ranges.push_back({L, R});
    sum[0] = ranges[0].second - ranges[0].first + 1;
    for(int i = 1; i < (ll) ranges.size(); i++) sum[i] = sum[i - 1] + ranges[i].second - ranges[i].first + 1;
    ll d = (ll) ranges.size() - 1;
    while(Q--)
    {
        cin >> dan;
        ll l = -1, r = d + 1;
        while(r - l >= 2)
        {
            ll mid = (l + r)/2;
            if(dan < ranges[mid].first) r = mid;
            else l = mid;
        }
        if(l == -1) cout << 0 << endl;
        else
        {
            if(dan > ranges[l].second) cout << sum[l] << endl;
            else cout << ((l != 0) ? sum[l - 1] : 0) + dan - ranges[l].first + 1 << endl;
        }
    }
    return 0;
}