#include <algorithm>
#include <ios>
#include <iostream>
#include <vector>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    int n, q;
    cin >> n >> q;
    long long a[n];
    long long b[n];
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    long long c[q];
    for (int i = 0; i < q; i++) cin >> c[i];

    vector<long long> d(n);
    long long s = 0;
    for (int i = 1; i < n; i++) {
        if (a[i]-a[i-1] <= b[i-1]) {
            s += b[i-1];
            d[i-1] += a[i]-a[i-1];
            s -= a[i]-a[i-1];
        } else {
            d[i-1] += b[i-1];
        }
    }

    d[n-1] += s+b[n-1];

    for (int i = 1; i < n; i++) {
        d[i] += d[i-1]; 
    }

    for (int i = 0; i < q; i++) {
        int ix = lower_bound(a, a+n, c[i]) - a - 1;
        if (ix == -1) cout << 0 << '\n';
        else {
            int tix = max(ix-1, 0);
            if (tix == ix) cout << min(d[tix], c[i]-a[ix]+1) << '\n';
            else {
                long long s = d[ix];
                long long p = d[tix];
                if (c[i]-a[ix] > s) p = d[ix];
                else p+=c[i] - a[ix] + 1;

                cout << p << '\n';
            }
        }
    } 
}