#include <bits/stdc++.h>
using namespace std;
long long X, n, q;
long long a[100010];
long long mn[100010], mx[100010], sum[100010];
long long hi[100010], lo[100010];
int main() {
  cin >> X >> n;
  for (long long i = (long long)(0); i < (long long)(n); i++) cin >> a[i];
  long long crtsum = 0;
  mn[0] = 0;
  mx[0] = X;
  sum[0] = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    mx[i + 1] = mx[i];
    mn[i + 1] = mn[i];
    if (i % 2 == 0) {
      long long crtmn = crtsum + a[i];
      if (mn[i] < crtmn) {
        mn[i + 1] = crtmn;
      }
    } else {
      long long crtmx = X + crtsum - a[i];
      if (mx[i] > crtmx) {
        mx[i + 1] = crtmx;
      }
    }
    crtsum += (i % 2 == 0 ? a[i] : -a[i]) * 2;
    sum[i + 1] = crtsum;
  }
  lo[0] = 0;
  hi[0] = X;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    hi[i + 1] = hi[i];
    lo[i + 1] = lo[i];
    if (i % 2 == 0) {
      if (i > 0) {
        hi[i + 1] -= a[i] - a[i - 1];
        lo[i + 1] -= a[i] - a[i - 1];
        hi[i + 1] = (hi[i + 1] > 0LL ? hi[i + 1] : 0LL);
        lo[i + 1] = (lo[i + 1] > 0LL ? lo[i + 1] : 0LL);
      } else {
        hi[i + 1] -= a[i];
        lo[i + 1] -= a[i];
        hi[i + 1] = (hi[i + 1] > 0LL ? hi[i + 1] : 0LL);
        lo[i + 1] = (lo[i + 1] > 0LL ? lo[i + 1] : 0LL);
      }
    } else {
      hi[i + 1] += a[i] - a[i - 1];
      lo[i + 1] += a[i] - a[i - 1];
      hi[i + 1] = (hi[i + 1] < X ? hi[i + 1] : X);
      lo[i + 1] = (lo[i + 1] < X ? lo[i + 1] : X);
    }
  }
  cin >> q;
  for (long long i = (long long)(0); i < (long long)(q); i++) {
    long long T, A;
    cin >> T >> A;
    long long idx = lower_bound(a, a + n, T) - a;
    if (idx > 0) T -= a[idx - 1];
    if (A <= mn[idx]) {
      if (idx % 2 == 0)
        cout << max(lo[idx] - T, 0LL) << endl;
      else
        cout << min(lo[idx] + T, X) << endl;
    } else if (A >= mx[idx]) {
      if (idx % 2 == 0)
        cout << max(hi[idx] - T, 0LL) << endl;
      else
        cout << min(hi[idx] + T, X) << endl;
    } else {
      if (idx % 2 == 0) {
        cout << A - sum[idx] - (idx > 0 ? a[idx - 1] : 0) - T << endl;
      } else {
        cout << A - sum[idx] + (idx > 0 ? a[idx - 1] : 0) + T << endl;
      }
    }
  }
  return 0;
}
