#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::make_pair;
using std::pair;
using std::priority_queue;
using std::string;
using std::vector;
unsigned long long i, j, k, l, m, n;
unsigned long long H, W, Q;
unsigned long long b, c, y;
long long a, t, x, X;
unsigned long long K, N, M;
int main() {
  cin >> X >> K;
  vector<long long> r(K + 1), L(K + 1), R(K + 1), S(K + 1);
  S[0] = L[0] = R[0] = r[0] = 0;
  for (i = 1; i <= K; ++i) {
    cin >> r[i];
    if (i & 1) {
      S[i] = std::max(S[i - 1] - r[i] + r[i - 1], -X);
      if (S[L[i - 1]] >= S[i]) {
        L[i] = i;
      } else {
        L[i] = L[i - 1];
      }
      R[i] = R[i - 1];
    } else {
      S[i] = std::min(S[i - 1] + r[i] - r[i - 1], X);
      if (S[R[i - 1]] <= S[i]) {
        R[i] = i;
      } else {
        R[i] = R[i - 1];
      }
      L[i] = L[i - 1];
    }
  }
  cin >> Q;
  i = 0;
  while (Q--) {
    cin >> t >> a;
    while (i < K && r[i + 1] <= t) i++;
    if (i & 1) {
      if (L[i] < R[i]) {
        if (S[R[i]] - S[L[i]] >= X || a + S[R[i]] >= X) {
          x = X + S[i] - S[R[i]];
        } else {
          x = std::max(a + S[L[i]], 0LL) + S[i] - S[L[i]];
        }
      } else {
        if (S[L[i]] - S[R[i]] <= -X || a + S[L[i]] <= 0) {
          x = S[i] - S[L[i]];
        } else {
          x = std::min(a + S[R[i]], X) + S[i] - S[R[i]];
        }
      }
      x += t - r[i];
      cout << std::min(x, X) << '\n';
    } else {
      if (L[i] < R[i]) {
        if (S[R[i]] - S[L[i]] >= X || a + S[R[i]] >= X) {
          x = X + S[i] - S[R[i]];
        } else {
          x = std::max(a + S[L[i]], 0LL) + S[i] - S[L[i]];
        }
      } else {
        if (S[L[i]] - S[R[i]] <= -X || a + S[L[i]] <= 0) {
          x = S[i] - S[L[i]];
        } else {
          x = std::min(a + S[R[i]], X) + S[i] - S[R[i]];
        }
      }
      x += -t + r[i];
      cout << std::max(x, 0LL) << '\n';
    }
  }
  return 0;
}
