#include <bits/stdc++.h>
using namespace std;
const long long INF = 1l << 60;
long long X, K;
vector<pair<long long, long long> > events;
const long long REV = -1;
void normalize(long long &a) {
  if (a < 0) a = 0;
  if (a > X) a = X;
}
signed main() {
  cin >> X >> K;
  for (long long i = 0; i < (K); ++i) {
    long long r;
    cin >> r;
    events.push_back(pair<long long, long long>(r, REV));
  }
  long long Q;
  cin >> Q;
  for (long long i = 0; i < (Q); ++i) {
    long long t, a;
    cin >> t >> a;
    events.push_back(pair<long long, long long>(t, a));
  }
  sort(events.begin(), events.end());
  long long b = 0, c = X, ans0 = 0, ansX = X, ansM = 0;
  long long pre = 0;
  bool Aup = true;
  for (long long i = 0; i < (events.size()); ++i) {
    pair<long long, long long> p = events[i];
    if (p.second == REV) {
      long long d = p.first - pre;
      if (Aup) {
        ans0 -= d;
        ansX -= d;
        ansM -= d;
        b = max(b, -ansM);
        c = min(c, ansM + X);
      } else {
        ans0 += d;
        ansX += d;
        ansM += d;
        b = max(b, -ansM);
        c = min(c, ansM + X);
      }
      pre = p.first;
      Aup = !Aup;
      normalize(ans0);
      normalize(ansX);
      normalize(b);
      normalize(c);
    } else {
      long long a = p.second;
      long long ans;
      if (a <= b)
        ans = ans0;
      else if (a < c)
        ans = ansM + a;
      else
        ans = ansX;
      if (Aup)
        ans -= p.first - pre;
      else
        ans += p.first - pre;
      normalize(ans);
      cout << ans << endl;
    }
  }
  return 0;
}
