#include <bits/stdc++.h>

#define int long long 

#define pb push_back
 
#define F first
 
#define S second
 
using namespace std;
 
const int N = 3e5 + 10;

const int mod = 1e9 + 7;

const int inf = 1e9;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int n,q;
 	cin >> n >> q;
 	vector<int>a(n + 1),b(n + 1);
 	vector<pair<int,int>>start(n + 1);
 	vector<int>kveri(q + 1);
 	int x = 0,r = 0;
 	for(int i = 1; i <= n; i++) {
 		cin >> a[i] >> b[i];
 		if(a[i] >= r) {
 			start[i] = {a[i],b[i]};
 		}else {
 			start[i] = {r,b[i]};
 		}
 		r = start[i].F + start[i].S;
 	}
 	vector<int>pref(n + 1);
 	for(int i = 1; i <= n; i++) {
 		pref[i] = pref[i - 1] + start[i].S;
 	}
 	while(q--) {
 		int x;
 		cin >> x;
 		int l = 1,r = n,ans = 0;
 		while(l <= r) {
 			int mid = (l + r) / 2;
 			if(start[mid].F + start[mid].S <= x) {
 				ans = mid;
 				l = mid + 1;
 			}else {
 				r = mid - 1;
 			}
 		}
 		int res = pref[ans];
 		if(ans < n && start[ans + 1].F <= x) {
 			res += x - start[ans + 1].F + 1;
 		}
 		cout << res << "\n";
 	}
    return 0;
}