#include <bits/stdc++.h>
using namespace std;
long long R[100005];
long long T[100005];
long long K;
long long X;
long long Q;
struct bucket {
  long long l, r;
  vector<pair<long long, long long> > start;
  void compute() {
    long long st = 0;
    for (long long i = l; i <= r; i++) {
      if (R[i] >= 0) {
        if (st + R[i] > X) {
          st = X;
        } else {
          if (X - R[i] - st >= 0 && X - R[i] - st <= X)
            start.push_back({X - R[i] - st, 0});
          st += R[i];
        }
      } else {
        if (st + R[i] < 0) {
          if (0 - R[i] - st >= 0 && 0 - R[i] - st <= X)
            start.push_back({0 - R[i] - st, 0});
          st = 0;
        } else {
          st += R[i];
        }
      }
    }
    for (auto &it : start) {
      long long st = 0;
      for (long long i = l; i <= r; i++) {
        st += T[i];
        st = max(st, -it.first);
        st = min(st, X - it.first);
      }
      it.second = st;
    }
    start.push_back({0, st});
    sort(start.begin(), start.end());
  }
} V[1000];
int main() {
  scanf("%lld", &X);
  scanf("%lld", &K);
  for (long long i = 1; i <= K; i++) scanf("%lld", &T[i]);
  for (long long i = 1; i <= K; i++) {
    if (i & 1) {
      R[i] = max(-X, T[i - 1] - T[i]);
    } else {
      R[i] = min(X, T[i] - T[i - 1]);
    }
  }
  long long ind = 0;
  for (long long i = 1; i <= K; i += 334) {
    V[++ind].l = i;
    V[ind].r = min(K, i + 334 - 1);
    V[ind].compute();
  }
  scanf("%lld", &Q);
  while (Q--) {
    long long t, a;
    scanf("%lld %lld", &t, &a);
    long long i;
    for (i = 1; i <= ind && T[V[i].r] < t; i++) {
      a +=
          (lower_bound(V[i].start.begin(), V[i].start.end(), make_pair(a, 0LL)))
              ->second;
    }
    if (ind < i) {
      a = min(X, max(0LL, a + (K % 2 ? 1 : -1) * (t - T[K])));
      printf("%lld\n", a);
      continue;
    }
    i = V[i].l;
    while (T[i] < t) {
      a = min(X, max(0LL, a + (i % 2 ? -1 : 1) * (T[i] - T[i - 1])));
      i++;
    }
    a = min(X, max(0LL, a + (i % 2 ? -1 : 1) * (t - T[i - 1])));
    printf("%lld\n", a);
  }
  return 0;
}
