#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define sc second
#define endl "\n"
#define pii pair<int,int>

using namespace std;

const int MAXN = 1e5+5;
const int mod7 = 1e9+7;
const long long inf = 1e18+10;

signed main()
{
    ios_base::sync_with_stdio(false),cin.tie(0), cout.tie(0);
    int tt=1;
    //cin >> tt;
    while(tt--)
    {
        int n,q;
        cin >> n >> q;
        vector<pii> niz(n);
        for(int i=0; i<n; i++)cin >> niz[i].fi >> niz[i].sc;
        vector<pii>noviniz;
        noviniz.pb({niz[0].fi, niz[0].fi+niz[0].sc - 1});
        int last = niz[0].fi+niz[0].sc - 1;
        for(int i=1; i<n; i++)
        {
            if(niz[i].fi <= last)niz[i].fi = last+1;
            noviniz.pb({niz[i].fi, niz[i].fi+niz[i].sc - 1});
            last = niz[i].fi+niz[i].sc - 1;
        }
        vector<int> pomoc;
        for(int i=0; i<n; i++)pomoc.pb(noviniz[i].fi);
        //for(auto x: noviniz)cout << x.fi << " " << x.sc << endl;
        vector<int> pref(n+1);
        pref[0] = 0;
        for(int i=1; i<=n; i++)pref[i] = pref[i-1] + noviniz[i-1].sc - noviniz[i-1].fi+1;
        //for(auto x:pref)cout << x << " ";cout << endl;
        while(q--)
        {
            int x;
            cin >> x;
            int pozicija = upper_bound(all(pomoc), x) - pomoc.begin()-1;
            int rez = 0;
            if(pozicija>=0)rez = pref[pozicija] + max(0ll, min(x,noviniz[pozicija].sc)-noviniz[pozicija].fi+1);
            cout << rez << endl;
        }

    }
}

/*
4 2
3 4
4 5
7 9
9 3
6
7
*/