#include <bits/stdc++.h>
long long left[100010], right[100010];
long long leftV[100010], rightV[100010];
long long t[100010];
long long v, k;
int main() {
  scanf("%lld%lld", &v, &k);
  for (long long i = (1); i < (k + 1); i++) scanf("%lld", t + i);
  left[0] = 0, leftV[0] = 0;
  right[0] = v, rightV[0] = v;
  for (long long i = (1); i < (k + 1); i++) {
    long long time = t[i] - t[i - 1];
    if (i % 2) {
      if (rightV[i - 1] <= time) {
        left[i] = 0, leftV[i] = v;
        right[i] = v, rightV[i] = v;
      } else if (leftV[i - 1] >= time) {
        left[i] = left[i - 1], leftV[i] = v - (leftV[i - 1] - time);
        right[i] = right[i - 1], rightV[i] = v - (rightV[i - 1] - time);
      } else {
        left[i] = left[i - 1] + (time - leftV[i - 1]);
        leftV[i] = v;
        right[i] = right[i - 1];
        rightV[i] = v - (rightV[i - 1] - time);
      }
    } else {
      if (leftV[i - 1] <= time) {
        left[i] = 0, leftV[i] = v;
        right[i] = v, rightV[i] = v;
      } else if (rightV[i - 1] >= time) {
        left[i] = left[i - 1], leftV[i] = v - (leftV[i - 1] - time);
        right[i] = right[i - 1], rightV[i] = v - (rightV[i - 1] - time);
      } else {
        left[i] = left[i - 1];
        leftV[i] = v - (leftV[i - 1] - time);
        right[i] = right[i - 1] - (time - rightV[i - 1]);
        rightV[i] = v;
      }
    }
  }
  long long q;
  scanf("%lld", &q);
  while (q--) {
    long long time;
    long long a;
    scanf("%lld%lld", &time, &a);
    long long l = 0, r = k + 1;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      if (t[m] <= time)
        l = m;
      else
        r = m;
    }
    time -= t[l];
    long long ans;
    if (a <= left[l]) {
      ans = ((leftV[l] - time) > (0) ? (leftV[l] - time) : (0));
    } else if (a >= right[l]) {
      ans = ((rightV[l] - time) > (0) ? (rightV[l] - time) : (0));
    } else {
      if (l % 2) {
        ans = ((leftV[l] - (a - left[l]) - time) > (0)
                   ? (leftV[l] - (a - left[l]) - time)
                   : (0));
      } else {
        ans = ((leftV[l] + (a - left[l]) - time) > (0)
                   ? (leftV[l] + (a - left[l]) - time)
                   : (0));
      }
    }
    printf("%lld\n", l % 2 ? v - ans : ans);
  }
  return 0;
}
