#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)(1e+9) + 7;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-12;
const long double pi = acos(-1.0);
long long b[1 << 17][2];
long long f[1 << 17][3];
long long r[1 << 17];
int main() {
  long long x;
  int k;
  cin >> x >> k;
  b[0][0] = 0;
  b[0][1] = x;
  f[0][0] = 0;
  f[0][1] = 0;
  f[0][2] = x;
  r[0] = 0;
  for (int i = 0; i < k; i++) {
    cin >> r[i + 1];
  }
  k++;
  for (int i = 0; i < k - 1; i++) {
    long long dif = r[i + 1] - r[i];
    if (i % 2 == 0) {
      dif = min(dif, x);
      f[i + 1][0] = x - max(f[i][0] - dif, (long long)0);
      f[i + 1][2] = x - max(f[i][2] - dif, (long long)0);
      f[i + 1][1] = -f[i][1] + dif;
      b[i + 1][0] = max(b[i][0], dif - f[i][1]);
      b[i + 1][1] = b[i][1];
    } else {
      dif = min(dif, x);
      f[i + 1][0] = x - max(f[i][0] - dif, (long long)0);
      f[i + 1][2] = x - max(f[i][2] - dif, (long long)0);
      f[i + 1][1] = -f[i][1] + dif;
      b[i + 1][0] = b[i][0];
      b[i + 1][1] = min(b[i][1], f[i][1] - dif);
    }
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    long long t, a;
    cin >> t >> a;
    int loc = upper_bound(r, r + k, t) - r;
    loc--;
    long long rest = t - r[loc];
    long long ans;
    if (a <= b[loc][0]) {
      ans = max((long long)0, f[loc][0] - rest);
    } else if (a >= b[loc][1]) {
      ans = max((long long)0, f[loc][2] - rest);
    } else {
      long long ini = f[loc][1];
      if (loc % 2)
        ini = ini + x - a;
      else
        ini += a;
      ans = max((long long)0, ini - rest);
    }
    if (loc % 2)
      cout << x - ans << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
