#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long X;
  cin >> X;
  int K;
  cin >> K;
  vector<long long> R(K);
  for (int i = 0; i < (K); ++i) cin >> R[i];
  R.push_back(R.back() + 2 * X);
  int Q;
  cin >> Q;
  vector<long long> T(Q), A(Q);
  for (int i = 0; i < (Q); ++i) cin >> T[i] >> A[i];
  long long left = 0, right = X;
  long long lval = 0, rval = X;
  int now = 0;
  vector<long long> ans(Q, -1);
  for (int i = 0; i < R.size(); i++) {
    while (now < Q && T[now] < R[i]) {
      long long plus = T[now] - (i == 0 ? 0 : R[i - 1]);
      if (i % 2 == 0) plus *= (-1);
      if (A[now] <= left)
        ans[now] = max(0ll, min(X, lval + plus));
      else if (A[now] >= right)
        ans[now] = max(0ll, min(X, rval + plus));
      else {
        ans[now] = max(0ll, min(X, lval + (A[now] - left) + plus));
      }
      now++;
    }
    long long d = R[i] - (i == 0 ? 0 : R[i - 1]);
    if (i % 2 == 0) {
      left += max(0ll, d - lval);
      lval = max(0ll, lval - d);
      rval = max(0ll, rval - d);
    } else {
      right -= max(0ll, rval + d - X);
      rval = min(X, rval + d);
      lval = min(X, lval + d);
    }
    if (left > right) {
      left = right;
      lval = rval;
    }
  }
  for (int i = 0; i < (Q); ++i) cout << ans[i] << endl;
  return 0;
}
