#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long N,Q;
    cin >> N >> Q;
    vector<long long> p(N), d(N), k(Q),np(N);
    for(int i = 0; i < N; i++) {
        cin >> d[i] >> p[i];
    }
    for(int i = 0; i < Q; i++) {
        cin >> k[i];
    }
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            np[i] = d[i]-1;
        }
        else {
            if(d[i+1] - d[i] < p[i]) {
                np[i] = np[i-1];
            }
            else{
                np[i] = np[i-1] + d[i+1] - d[i] - p[i];
            }
        }
    }
    for(int i = 0; i < Q; i++) {
        auto it = upper_bound(d.begin(), d.end(), k[i]);
        int index = distance(d.begin(), it);
        cout << np[index] + max(k[i]+1-d[index]-p[index], 0) << endl;
    }
}