#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from, to;
  long long cost;
};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long x, k, q, t, aa, diff;
  cin >> x >> k;
  vector<long long> r(k), a(k), b(k), c(k);
  for (int i = 0; i < k; i++) {
    cin >> r[i];
    if (i > 0) diff = r[i] - r[i - 1];
    if (i == 0) {
      if (r[i] > x) {
        a[i] = 0;
        b[i] = 0;
        c[i] = 0;
      } else {
        a[i] = r[i];
        b[i] = x;
        c[i] = -r[i];
      }
    } else if (i % 2 == 0) {
      if (b[i - 1] + c[i - 1] - diff <= 0) {
        a[i] = 0;
        b[i] = 0;
        c[i] = 0;
      } else {
        if (a[i - 1] + c[i - 1] - diff <= 0) {
          a[i] = c[i - 1] + diff;
        } else {
          a[i] = max(a[i - 1], -c[i - 1] + diff);
        }
        b[i] = b[i - 1];
        c[i] = c[i - 1] - diff;
      }
    } else {
      if (a[i - 1] + c[i - 1] + diff >= x) {
        a[i] = 0;
        b[i] = 0;
        c[i] = x;
      } else {
        a[i] = a[i - 1];
        if (b[i - 1] + c[i - 1] + diff >= x) {
          b[i] = -c[i - 1] + x - diff;
        } else {
          b[i] = min(b[i - 1], -c[i - 1] + (x - diff));
        }
        c[i] = c[i - 1] + diff;
      }
    }
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> t >> aa;
    long long ans,
        ii = (long long)(upper_bound(r.begin(), r.end(), t) - r.begin()) - 1;
    if (ii == -1) {
      cout << max(0LL, aa - t) << endl;
      continue;
    }
    if (aa <= a[ii]) {
      ans = a[ii] + c[ii];
    } else if (aa >= b[ii]) {
      ans = b[ii] + c[ii];
    } else {
      ans = aa + c[ii];
    }
    if (ii % 2 == 1) {
      ans = max(0LL, ans - (t - r[ii]));
    } else {
      ans = min(x, ans + (t - r[ii]));
    }
    cout << ans << endl;
  }
}
