#include <bits/stdc++.h>
const long long inf = 1e17 + 7;
long long r[100005];
long long prefix[100005];
int f[100005][18];
long long stMax(int l, int r) {
  long long res = -inf;
  for (int i = l; i <= r; i++)
    if (prefix[i] > res) res = prefix[i];
  return res;
}
long long stMin(int l, int r) {
  long long res = inf;
  for (int i = l; i <= r; i++)
    if (prefix[i] < res) res = prefix[i];
  return res;
}
int getNextStep(int p, long long have, long long x, int n) {
  int L = p + 1, R = n;
  int res = n + 1;
  while (L <= R) {
    int M = (L + R) / 2;
    long long maxC = stMax(p + 1, M) - prefix[p],
              minC = stMin(p + 1, M) - prefix[p];
    if (have + maxC >= x || have + minC <= 0) {
      res = M;
      R = M - 1;
    } else
      L = M + 1;
  }
  return res;
}
void preWork(int n, long long x) {
  for (int i = n; i >= 1; i--) {
    long long have = -1;
    if (i % 2)
      have = 0;
    else
      have = x;
    f[i][0] = getNextStep(i, have, x, n);
  }
}
int getLast(long long t, int n) {
  int L = 0, R = n;
  int res = -1;
  while (L <= R) {
    int M = (L + R) / 2;
    if (r[M] <= t) {
      res = M;
      L = M + 1;
    } else
      R = M - 1;
  }
  return res;
}
int main() {
  long long x;
  int n;
  scanf("%lld%d", &x, &n);
  r[0] = 0, prefix[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &r[i]);
    if (i % 2)
      prefix[i] = prefix[i - 1] - (r[i] - r[i - 1]);
    else
      prefix[i] = prefix[i - 1] + (r[i] - r[i - 1]);
  }
  prefix[n + 1] = r[n + 1] = inf;
  preWork(n, x);
  int q;
  scanf("%d", &q);
  for (int rnd = 0; rnd < q; rnd++) {
    long long t, a;
    scanf("%lld%lld", &t, &a);
    int next = getNextStep(0, a, x, n);
    if (r[next] >= t) {
      int last = getLast(t, next);
      a += prefix[last];
      long long left = t - r[last];
      if (last % 2)
        a += left;
      else
        a -= left;
      if (a < 0) a = 0;
      if (a > x) a = x;
      printf("%lld\n", a);
    } else {
      int cur = next;
      while (r[f[cur][0]] <= t) cur = f[cur][0];
      long long have = -1;
      if (cur % 2)
        have = 0;
      else
        have = x;
      int last = getLast(t, n);
      a = have + prefix[last] - prefix[cur];
      long long left = t - r[last];
      if (last % 2)
        a += left;
      else
        a -= left;
      if (a < 0) a = 0;
      if (a > x) a = x;
      printf("%lld\n", a);
    }
  }
  return 0;
}
