#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, q;
    cin>>n>>q;
    long long o, p, r, l;
    cin>>o>>p;
    vector<long long> a, b, c;

    for(int i=0; i<n - 1; i++)
    {
        cin>>r>>l;
        if(o + p >= r)
        {
            p += l;
        }
        else
        {
            a.push_back(o);
            b.push_back(p + o - 1);
            if(c.size() > 0)
                c.push_back(c.back() + p);
            else
                c.push_back(p);
            o = r;
            p = l;
        }
    }
    a.push_back(o);
    b.push_back(p + o - 1);
    if(c.size() > 0)
        c.push_back(c.back() + p);
    else
        c.push_back(p);

    for(int w = 0; w < q; w++)
    {
        cin >> o;
        auto g = upper_bound(a.begin(), a.end(), o) - a.begin();
        if (g == 0) {
            cout << 0 << endl;
        }
        else
        {
            g--;
            if (o <= b[g])
            {
                if(g > 0)
                    cout<<c[g - 1] + o - a[g] + 1<<endl;
                else
                    cout<<o - a[g] + 1<<endl;
            }
            else
                cout << c[g] << endl;
        }

    }


    return 0;
}