#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline bool chmax(A &a, B b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename A, typename B>
inline bool chmin(A &a, B b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1ll << 30;
const long long MOD = 1000000007;
const double EPS = 1e-10;
const bool debug = 0;
int X, K;
int R[112345];
int Q;
int t[112345], a[112345];
int ans[112345];
int main() {
  cin >> X >> K;
  R[0] = 0;
  for (int i = (0); i < (K); i++) scanf("%d", R + i + 1);
  R[K + 1] = INF;
  cin >> Q;
  for (int i = (0); i < (Q); i++) scanf("%d %d", t + i, a + i);
  int pos = 0;
  long long l = 0, lsum = 0, r = X, rsum = X, sum = 0;
  for (int i = (0); i < (K + 1); i++) {
    int tmp;
    while (pos < Q && R[i + 1] >= t[pos]) {
      tmp = t[pos] - R[i];
      if (i % 2 == 0) tmp = -tmp;
      int res;
      if (l >= a[pos])
        res = lsum + tmp;
      else if (r <= a[pos])
        res = rsum + tmp;
      else
        res = a[pos] + sum + tmp;
      chmax(res, 0);
      chmin(res, X);
      ans[pos++] = res;
    }
    tmp = R[i + 1] - R[i];
    if (i % 2 == 0) tmp = -tmp;
    lsum += tmp;
    rsum += tmp;
    sum += tmp;
    if (lsum <= 0) {
      chmax(l, -lsum);
      lsum = 0;
    }
    if (rsum >= X) {
      chmin(r, X - (rsum - X));
      rsum = X;
    }
    if (lsum >= X) lsum = X;
    if (rsum <= 0) rsum = 0;
  }
  for (int i = (0); i < (Q); i++) printf("%d\n", ans[i]);
  return 0;
}
