#include <iostream>

using namespace std;

int main() {
    
    int n, q; cin >> n >> q;
    pair<int, int> dani[300000];
    for (int i = 0; i < n; i++) {
        cin >> dani[i].first >> dani[i].second;
    }
    
    for (int k = 0; k < q; k++) {
        int brojPlazmi = 0, kraj; cin >> kraj;
        for (int i = 0; i < n; i++) {
            if (dani[i + 1].first - dani[i].first >= dani[i].second)
                if (dani[i].first + dani[i].second < kraj)
                    brojPlazmi += dani[i].second;
                else
                    brojPlazmi += kraj - dani[i].first + 1;
        }
        cout << brojPlazmi << '\n';
    }

    return 0;
}