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

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, q; cin >> n >> q;

    vector<int> lp;
    vector<int> rp;
    lp.reserve(n);
    rp.reserve(n);

    int lastd = 0;
    int sum = 0;

    for(int i = 0; i < n; i++){
        int d, p; cin >> d >> p;
        d = max(d, lastd);
        lp.push_back(d);
        rp.push_back(d+p-1);
        lastd=d+p;
    }
    vector<int> pref(n);
    pref[0]=rp[0]-lp[0]+1;

    for(int i = 1; i < n; i++){
        pref[i]=pref[i-1]+rp[i]-lp[i]+1;
    }
   /* for(int i = 0; i < n; i++) cout << pref[i] << " ";
    cout << '\n';
    for(int i = 0; i < n; i++){
        cout << lp[i] << " ";
    }cout << '\n';
    for(int i = 0; i < n; i++){
        cout << rp[i] << " ";
    }cout << '\n';*/

    while(q--){
        int k; cin >> k;
        int lb = upper_bound(lp.begin(), lp.end(), k)-lp.begin();
        if(lb==0){
            cout << "0\n"; continue;
        }
        lb-=1;
        int ub = lower_bound(rp.begin(), rp.end(), k)-rp.begin();
        if(lb==ub){
            int ans = (lb==0 ? 0 : pref[lb-1]);
            ans+=k-lp[lb]+1;
            cout << ans << '\n';
        }else{
            cout << pref[lb] << '\n';
        }

    }



    return 0;
}