#include <stdio.h>
#include <stdlib.h>

int main()
{
    int N, Q;
    long long int dani;
    scanf("%d%d", &N, &Q);
    long long int q[Q], d[N], stanje[N], suma[N];
    int k[N];
    for(int i=0; i<N; i++)
        scanf("%lld%d", &d[i], &k[i]);
    for(int i=0; i<Q; i++)
        scanf("%lld", &q[i]);
    stanje[0] = k[0]-1;
    suma[0] = 1;
    for(int i=1; i<N; i++)
    {
        dani = d[i] - d[i-1] - 1;
        if(stanje[i-1]<=dani)
        {
            stanje[i] = k[i] - 1;
            suma[i] = suma[i-1] + stanje[i-1] + 1;
        }
        else
        {
            stanje[i] = stanje[i-1] - dani + k[i] - 1;
            suma[i] = suma[i-1] + dani + 1;
        }
    }
    int a=0;
    for(int i=0; i<Q; i++)
    {
        if(q[i]<d[0])
            printf("0\n");
        else if(q[i]>=d[N-1])
        {
            dani = q[i] - d[N-1];
            if(stanje[N-1] >= dani)
                printf("%lld\n", suma[N-1]+dani);
            else
                printf("%lld\n", suma[N-1]+stanje[N-1]);
        }
        else
        {
            for(int j=a; j<N; j++)
            {
                if(d[j]>q[i])
                {
                    a = j-1;
                    dani = q[i] - d[j-1];
                    if(stanje[j-1] >= dani)
                        printf("%lld\n", suma[j-1]+dani);
                    else
                        printf("%lld\n", suma[j-1]+stanje[j-1]);
                    break;
                }
            }
        }
    }
    return 0;
}