#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long R[101010], T[101010], A[101010];
int main() {
  long long X;
  int K;
  cin >> X >> K;
  for (int i = 0; i < (K); i++) cin >> R[i + 1];
  int Q;
  cin >> Q;
  for (int i = 0; i < (Q); i++) cin >> T[i + 1] >> A[i + 1];
  int l = 1;
  long long lb = 0, ub = X, sum = 0, sum2 = 0, lo = 0, hi = X;
  for (int i = 1; i <= K; i++) {
    while (T[l] <= R[i] && l <= Q) {
      long long a = A[l], tmp = a >= X / 2 ? hi : lo;
      if (a >= lb && a <= ub) tmp = (a + sum);
      if (i % 2)
        cout << max(0LL, tmp - (T[l] - R[i - 1]));
      else
        cout << min(X, tmp + (T[l] - R[i - 1]));
      cout << endl;
      l++;
    }
    long long d = R[i] - R[i - 1];
    if (i % 2) {
      sum -= d;
      sum2 += d;
      lb = sum2;
      lo = max(0LL, lo - d);
      hi = max(0LL, hi - d);
    } else {
      sum += d;
      sum2 -= d;
      ub = X + sum2;
      lo = min(X, lo + d);
      hi = min(X, hi + d);
    }
  }
  for (int i = l; i <= Q; i++) {
    long long a = A[i], tmp = a >= X / 2 ? hi : lo;
    if (a >= lb && a <= ub) tmp = (a + sum);
    if (K % 2 == 0)
      cout << max(0LL, tmp - (T[i] - R[K]));
    else
      cout << min(X, tmp + (T[i] - R[K]));
    cout << endl;
  }
  return 0;
}
