#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")

using namespace std;

#define int long long

void solve(){
    int n, q;
    cin>>n>>q;
    vector<int> d(n), p(n);
    for(int i = 0;i<n;i++){
        cin>>d[i]>>p[i];
    }
    vector<pair<int, int>> v;
    int s = 0, l = d[0];
    for(int i = 0;i<n;i++){
        s+=p[i];
        if(i==n-1){
            v.push_back({l, d[i]+s-1});
        } else{
            if(d[i]+s>=d[i+1]){
                s-=(d[i+1]-d[i]);
            } else{
                v.push_back({l, d[i]+s-1});
                s = 0;
                l = d[i+1];
            }
        }
    }
    int sz = v.size();
    vector<int> pref(sz+1);
    pref[0] = 0;
    for(int i = 0;i<sz;i++){
        pref[i+1] = pref[i]+v[i].second-v[i].first+1;
    }
    for(int i = 0;i<q;i++){
        int k;
        cin>>k;
        pair<int, int> pp = {k+1, 0};
        int id = lower_bound(v.begin(), v.end(), pp)-v.begin()-1;
        if(id==-1){
            cout<<0<<endl;
            continue;
        }
        cout<<pref[id]+min(k, v[id].second)-v[id].first+1<<endl;
    }
    return;
}

int32_t main(){
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}