#include<stdlib.h>
#include<stdio.h>
int lower_bound(long  long arr[], int N, long long X)
{
    int mid;
    int low = 0;
    int high = N;
    while (low < high) {
        mid = low + (high - low) / 2;
        if (X <= arr[mid]) {
            high = mid;
        }
        else {
            low = mid + 1;
        }
    }
    if(low < N && arr[low] < X) {
       low++;
    }
    return low;
}
int main()
{
  int n,q;
  scanf("%d%d", &n, &q);
  long long niz1[n], niz2[n], niz3[n];
  for(int i = 0; i < n; i++)
  {
    long long k,l;
    scanf("%lld%lld", &k, &l);
    niz1[i] = k;
    if((niz2[i-1]>(niz1[i]-niz1[i-1])) && (i != 0))
    {
      niz2[i] = l + (niz2[i-1]-(niz1[i]-niz1[i-1]));
      niz2[i-1] = niz1[i]-niz1[i-1];
    }
    else
    {
      niz2[i] = l;
    }
    if(i == 0)
    {
      niz3[i] = 0;
    }
    else
    {
      niz3[i] = niz3[i-1] + niz2[i-1];
    }
  }
  long long num;
  for(int i= 0; i < q; i++)
  {
    scanf("%lld", &num);
    if(num < niz1[0])
    {
      printf("0\n");
    }
    else
    {
      int z = lower_bound(niz1, n, num)-1;
      if(num > niz2[z] + niz3[z] + niz1[z])
      printf("%lld\n", niz2[z] + niz3[z]);
      else
      printf("%lld\n", niz3[z] + num - niz1[z]+1);
    }
  }

}