#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX;
const long long MOD = 1e9 + 7;
int main() {
  long long X;
  cin >> X;
  long long K;
  cin >> K;
  vector<long long> r(K + 1, 0);
  for (long long t = 0; (t) < (K); ++(t)) {
    cin >> r[t + 1];
  }
  r.push_back(INF);
  vector<long long> a(K + 1, 0), b(K + 1, X), c(K + 1, 0);
  for (long long t = 0; (t) < (K); ++(t)) {
    long long dif = r[t + 1] - r[t];
    if (t & 1) {
      c[t + 1] = c[t] + dif;
      a[t + 1] = a[t];
      b[t + 1] = min(b[t], X - c[t + 1]);
    } else {
      c[t + 1] = c[t] - dif;
      a[t + 1] = max(a[t], -c[t + 1]);
      b[t + 1] = b[t];
    }
  }
  long long Q;
  cin >> Q;
  for (long long q = 0; (q) < (Q); ++(q)) {
    long long t, x;
    cin >> t >> x;
    long long pt = upper_bound(r.begin(), r.end(), t) - r.begin() - 1;
    long long dif = t - r[pt];
    cerr << "dif"
         << ": " << dif << '\n';
    if (!(pt & 1)) dif *= -1;
    long long ans = c[pt];
    if (x < a[pt]) {
      ans += a[pt];
    } else if (x < b[pt]) {
      ans += x;
    } else {
      ans += b[pt];
    }
    ans = max(0ll, min(X, ans + dif));
    cout << ans << endl;
  }
  return 0;
}
