#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include <bits/stdc++.h>
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define eb emplace_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}
#define si(a) (ll)(a.size())
using namespace std;
using ld = double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pld = pair<ld,ld>;

#define mod 1
ll add(ll x,ll y){
	x+=y;
	if(x<0){
		x%=mod;
		x+=mod;
	}else{
		if(x>=mod) x%=mod;
	}
	return x;
}
ll mul(ll a,ll b){
	a = add(a,0);
	b = add(b,0);
	ll ans = (a*b)%mod;
	if(ans<0) ans+=mod;
	return ans;
}



const ll maxn = 300005;
ll n,q;
pll a[maxn];
void tc(){
	cin >> n >> q;
	for(ll i = 1;i<=n;i++) cin >> a[i].fi >> a[i].sc;
	vector<pll> v;
	v.pb({a[1].fi,a[1].fi+a[1].sc-1});
	for(ll i = 2;i<=n;i++) {
		pll p = v.back();
		pll q = a[i];
		if(p.sc>=q.fi) {
			v.popb();
			p.sc+=q.sc;
		}else {
			v.pb({q.fi,q.fi+q.sc-1});
		}
	}
	ll i = 0;
	ll s = 0;
	while(q--) {
		ll k; cin >> k;
		while(i<si(v)&&k>v[i].sc) {
			s+=v[i].sc-v[i].fi+1;
			i++;
		}
		ll ans = s;
		if(i<si(v)) {
			if(k>=v[i].fi) ans+=k-v[i].fi+1;
		}
		cout<<ans<<endl;
	}
}

int main(){
	ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);
	int t; t = 1;
	while(t--){
		tc();
	}
	return (0-0);
}