#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1001;
const long long MOD = 1000000007;
signed main() {
  long long x, k;
  cin >> x >> k;
  long long r[k];
  for (long long i = 0; i < k; i++) cin >> r[i];
  long long q, d = 0;
  cin >> q;
  long long p = 0, t, a, amin = 0, amax = x;
  for (long long i = 0; i < q; i++) {
    cin >> t >> a;
    while (r[p] < t) {
      if (p % 2 == 0) {
        if (p == 0) {
          amin = r[p];
          if (amax < amin) amax = amin;
          d -= r[p];
        } else {
          amin = max(amin, amin - (r[p - 1] - r[p - 2]) + (r[p] - r[p - 1]));
          if (amax < amin) amax = amin;
          d -= (r[p] - r[p - 1]);
        }
      } else {
        if (p == 1) {
          amax = min(amax, amax + r[p - 1] - (r[p] - r[p - 1]));
        } else
          amax = min(amax, amax + (r[p - 1] - r[p - 2]) - (r[p] - r[p - 1]));
        if (amin > amax) amin = amax;
        d += (r[p] - r[p - 1]);
      }
      p++;
    }
    a = max(a, amin);
    a = min(a, amax);
    long long o = 0;
    if (p == 0)
      cout << min(max(a + d - t, o), x) << endl;
    else {
      if (p % 2 == 0)
        cout << min(max(a + d - (t - r[p - 1]), o), x) << endl;
      else
        cout << min(max(a + d + (t - r[p - 1]), o), x) << endl;
    }
  }
  return 0;
}
