#include <bits/stdc++.h>

using namespace std;

int n,q,g;
long long b1,b2,L[300010],R[300010],u;

int main()
{
    scanf("%d %d",&n,&q);
    for(int i=1; i<=n; i++)
    {
        scanf("%lld %lld",&b1,&b2);
        L[i] = max(R[i-1]+1,b1);
        R[i] = L[i]+b2-1;
    }
    g = 1;
    for(int i=1; i<=q; i++)
    {
        scanf("%lld",&b1);
        while(g<=n && R[g]<=b1)
        {
            u += R[g]-L[g]+1;
            g++;
        }
        if(g==n+1)
        {
            printf("%lld\n",u);
            continue;
        }
        printf("%lld\n",u+max(0ll,b1-L[g]+1));
    }
    return 0;
}