#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
using namespace std;

const int MAXN = 3 * 1e5 + 5;
int N, Q;
pair<ll, ll> A[MAXN];
ll k, R = 0, M;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N >> Q;
    for(int i = 1; i <= N; i++) cin >> A[i].f >> A[i].s;
    for(int i = 1, j = 1; j <= Q; j++)
    {
        cin >> k;
        while(A[i].f < k and i <= N)
        {
            M += max(A[i].f - R - 1, 0LL);
            if(R < A[i].second) R = A[i].f + A[i].second - 1;
            else R += A[i].second;
            i++;
        }
        cout << min(k, R) - M << "\n";
    }
    return 0;
}