#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long X;
long long K;
long long R[100005];
long long Q;
long long T[100005], A[100005];
struct Node {
  long long sum;
  long long delay;
  bool delayFlag;
  bool setFlag;
  Node() { sum = delay = delayFlag = setFlag = 0; }
};
long long n;
Node seg[2 * (2 << 20)];
void Init(long long _n) {
  n = 1;
  while (_n > n) n *= 2;
}
inline void DelayEvaluate(long long k, long long a, long long b,
                          bool flag = true) {
  if (!seg[k].delayFlag && !seg[k].setFlag) return;
  if (flag && k < n - 1) {
    DelayEvaluate(2 * k + 1, a, (a + b) / 2, false);
    DelayEvaluate(2 * k + 2, (a + b) / 2, b, false);
  }
  if (seg[k].setFlag) {
    seg[k].setFlag = false;
    seg[k].sum = 0;
    seg[k].delay = 0;
    if (k < n - 1) {
      seg[2 * k + 1].delay = seg[2 * k + 2].delay = 0;
      seg[2 * k + 1].setFlag = seg[2 * k + 2].setFlag = true;
    }
    return;
  }
  seg[k].sum += seg[k].delay;
  if (seg[k].sum < 0) {
    seg[k].sum = 0;
  }
  if (seg[k].sum > X) {
    seg[k].sum = X;
  }
  if (k < n - 1) {
    seg[2 * k + 1].delay += seg[k].delay;
    seg[2 * k + 2].delay += seg[k].delay;
    seg[2 * k + 1].delayFlag = seg[2 * k + 2].delayFlag = true;
  }
  seg[k].delay = seg[k].delayFlag = 0;
}
inline void UpdateNode(long long k) {
  seg[k].sum = seg[2 * k + 1].sum + seg[2 * k + 2].sum;
}
void setUpdate(long long l, long long r, long long k = 0, long long a = 0,
               long long b = n) {
  DelayEvaluate(k, a, b);
  if (b <= l || r <= a)
    return;
  else if (l <= a && b <= r) {
    seg[k].setFlag = true;
    DelayEvaluate(k, a, b);
  } else {
    long long mid = (a + b) / 2;
    setUpdate(l, r, 2 * k + 1, a, mid);
    setUpdate(l, r, 2 * k + 2, mid, b);
  }
}
void UpdateRange(long long l, long long r, long long v, long long k = 0,
                 long long a = 0, long long b = n) {
  DelayEvaluate(k, a, b);
  if (b <= l || r <= a) {
    return;
  } else if (l <= a && b <= r) {
    seg[k].delay += v;
    seg[k].delayFlag = true;
    DelayEvaluate(k, a, b);
    return;
  } else {
    long long mid = (a + b) / 2;
    UpdateRange(l, r, v, 2 * k + 1, a, mid);
    UpdateRange(l, r, v, 2 * k + 2, mid, b);
    UpdateNode(k);
    return;
  }
}
long long Query(long long l, long long r, long long k = 0, long long a = 0,
                long long b = n) {
  DelayEvaluate(k, a, b);
  if (b <= l || r <= a)
    return 0;
  else if (l <= a && b <= r) {
    return seg[k].sum;
  } else {
    long long vl, vr;
    long long mid = (a + b) / 2;
    vl = Query(l, r, 2 * k + 1, a, mid);
    vr = Query(l, r, 2 * k + 2, mid, b);
    return max(vl, vr);
  }
}
long long MidSearch(long long diff) {
  long long l = -1, r = n;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    long long q = Query(mid, mid + 1);
    if (q < diff) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return r;
}
signed main() {
  cin >> X;
  cin >> K;
  for (long long i = 0; i < K; i++) {
    cin >> R[i];
  }
  R[K++] = 1000000009;
  cin >> Q;
  for (long long i = 0; i < Q; i++) {
    cin >> T[i] >> A[i];
  }
  using II = pair<long long, long long>;
  vector<II> vec;
  vector<long long> position;
  position.resize(Q);
  for (long long i = 0; i < Q; i++) {
    vec.push_back(II(A[i], i));
  }
  sort(begin(vec), end(vec));
  Init(Q);
  for (long long i = 0; i < 2 * n + 1; i++) {
    if (i < Q) {
      UpdateRange(i, i + 1, vec[i].first);
      position[vec[i].second] = i;
    } else {
      seg[i + (n - 1)].sum = 1145141919810;
    }
  }
  long long pos = 0;
  for (long long i = 0; i < K; i++) {
    long long sign = i % 2 == 0 ? -1 : 1;
    while (T[pos] <= R[i] && pos < Q) {
      long long K = T[pos];
      if (i > 0) {
        K -= R[i - 1];
      }
      cout << min(X, max(Query(position[pos], position[pos] + 1) + sign * K,
                         (long long)0))
           << endl;
      pos++;
    }
    long long diff = R[i];
    if (i > 0) {
      diff = R[i] - R[i - 1];
    }
    if (sign > 0) {
      UpdateRange(0, Q, sign * diff);
    } else {
      long long L = MidSearch(diff);
      setUpdate(0, L);
      UpdateRange(L, n, sign * diff);
    }
  }
  return 0;
}
