#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 3e5+5;


int n, l;
array<int,2> a[MAXN];
int p[MAXN];

void solve(){
	int q;
	cin >> n >> q;
	int x, y;
	cin >> x >> y;
	a[l++] = {x,y};
	for(int i = 1; i < n; ++i){
		cin >> x >> y;
		if(x <= a[l-1][0]+a[l-1][1]){
			a[l-1][1] += y;
		}
		else{
			a[l++] = {x,y};
		}
	}
	for(int i = 0; i < l; ++i){
		p[i+1] = p[i]+a[i][1];
	}
	int r = 0;
	while(q--){
		cin >> x;
		while(true){
			if(r == l) break;
			if(a[r][0] > x || (a[r][0] <= x && a[r][0]+a[r][1] > x)) break;
			++r;
		}
		cout << p[r] + max(0ll, (r<l ? (x-a[r][0]+1) : 0ll)) << '\n';
	}
}

int32_t main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	int qqq=1;
	//cin>>qqq;
	while(qqq--)solve();
	return 0;
}