#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 2e5 + 20;

void solve()
{
    ll n,q;
    cin >> n >> q;
    vector<ll> a(n);
    vector<ll> b(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        cin >> b[i];
    }

    vector<pair<ll,ll>> pref(n);

    pref[0].first = 1;
    pref[0].second = b[0]-1;

    for(int i = 1; i < n; i++){
        if(a[i] >= pref[i-1].first+pref[i-1].second){
            pref[i].first = pref[i-1].first+pref[i-1].second;
            if(a[i] > pref[i-1].first+pref[i-1].second){
                pref[i].second = b[i]-1;
                pref[i].first++;
            }else{
                pref[i].second = b[i];
            }
        }else{
            pref[i].first = pref[i-1].first+(a[i]-a[i-1]);
            pref[i].second = b[i]+(pref[i-1].second-(a[i]-a[i-1]));
        }
    }




    while(q--){
        ll k;
        cin >> k;

        auto x = lower_bound(a.begin(),a.end(),k)-a.begin();

       // cout << "x: " << x << "\n";

        if(a[x]==k){
            cout << pref[x].first << "\n";
            continue;
        }
        if(x==n){
            if(k- a[x-1]>= pref[x-1].second){
                cout << pref[x-1].first+pref[x-1].second << "\n";
            }else{
                cout << pref[x-1].first+k-a[x-1] << "\n";
            }
            continue;
        }
        if(x==0 && a[0] > k){
            cout << 0 << "\n";
            continue;
        }
        x--;
        //cout << "x11: " << x << "\n";

        if(k-a[x] >= pref[x].second){
            cout << pref[x].first+pref[x].second << "\n";
        }else{
            cout << pref[x].first+(k-a[x]) << "\n";
        }
    }



}

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

}