#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int X;
  cin >> X;
  int K;
  cin >> K;
  vector<long long int> r(K);
  r.push_back(0);
  for (int i = int(0); i < int(K); i++) cin >> r[i + 1];
  vector<long long int> Cr(K + 1);
  for (int i = 0; i < K; i++) {
    if (i % 2 == 0) {
      Cr[i + 1] = max(0LL, Cr[i] - (r[i + 1] - r[i]));
    } else {
      Cr[i + 1] = min(X, Cr[i] + (r[i + 1] - r[i]));
    }
  }
  vector<long long int> BEr(K + 1), ENr(K + 1);
  BEr[0] = 0ll;
  ENr[0] = X;
  for (int i = 0; i < K; i++) {
    if (i % 2 == 0) {
      ENr[i + 1] = ENr[i];
      if (Cr[i] - (r[i + 1] - r[i]) < 0) {
        long long int inc = (r[i + 1] - r[i]) - Cr[i];
        BEr[i + 1] = min(BEr[i] + inc, ENr[i + 1]);
      } else {
        BEr[i + 1] = BEr[i];
      }
    } else {
      BEr[i + 1] = BEr[i];
      if (Cr[i] + (r[i + 1] - r[i]) + ENr[i] > X) {
        long long int tmp = (ENr[i] - BEr[i]) + Cr[i] + (r[i + 1] - r[i]);
        ENr[i + 1] = min(2 * X - tmp, ENr[i]);
        ENr[i + 1] = max(ENr[i + 1], BEr[i + 1]);
      } else {
        ENr[i + 1] = ENr[i];
      }
    }
  }
  int Q;
  cin >> Q;
  while (Q--) {
    long long int t, a = 0;
    cin >> t >> a;
    long long int A0 = a;
    int tpoint = upper_bound(begin(r), end(r), t) - r.begin() - 1;
    long long int BEt = BEr[tpoint];
    long long int ENt = ENr[tpoint];
    long long int Ct;
    if (tpoint % 2 == 0) {
      if (Cr[tpoint] - (t - r[tpoint]) < 0) {
        BEt = max(BEt, (t - r[tpoint]) - Cr[tpoint]);
      }
      Ct = max(0LL, Cr[tpoint] - (t - r[tpoint]));
    } else {
      if (Cr[tpoint] + (t - r[tpoint]) < 0) {
        long long int tmp =
            (ENr[tpoint] - BEr[tpoint]) + Cr[tpoint] + (t - r[tpoint]);
        ENt = min(2 * X - tmp, ENr[tpoint]);
      }
      Ct = min(X, Cr[tpoint] + (t - r[tpoint]));
    }
    long long int At;
    if (A0 < BEt) {
      At = Ct;
    } else if (ENt < A0) {
      At = Ct + (ENt - BEt);
    } else {
      At = Ct + (A0 - BEt);
    }
    cout << At << endl;
  }
  return 0;
}
