#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ll x, k;
  cin >> x >> k;
  vector<ll> r(k + 2), diff(k + 2);
  for (int i = 0; i < k; i++) {
    cin >> r[i + 1];
    diff[i + 1] = diff[i] + (i % 2 ? 1 : -1) * (r[i + 1] - r[i]);
  }
  r[k + 1] = 1e9 + 19;
  vector<ll> mi(k + 1, x + 1), ma(k + 1, -1);
  mi[0] = 0;
  ma[0] = x;
  ll rmi = 0, rma = x;
  vector<ll> rvaltop(k + 1), rvalbottom(k + 1);
  bool stop = 0;
  for (int i = 1; i <= k; i++) {
    int df = r[i] - r[i - 1];
    if (mi[i - 1] <= x) mi[i] = mi[i - 1];
    if (ma[i - 1] >= 0) ma[i] = ma[i - 1];
    if (i % 2) {
      rmi -= df;
      rma -= df;
    } else {
      rmi += df;
      rma += df;
    }
    if (rmi < 0) {
      if (mi[i] <= x) mi[i] += -rmi;
      rmi = 0;
    }
    if (rma < 0) {
      if (ma[i] >= 0) ma[i] += -rma;
      rma = 0;
    }
    if (rmi > x) {
      if (mi[i] <= x) mi[i] -= rmi - x;
      rmi = x;
    }
    if (rma > x) {
      if (ma[i] >= 0) ma[i] -= rma - x;
      rma = x;
    }
    rvalbottom[i] = rmi;
    rvaltop[i] = rma;
    if (mi[i] > ma[i]) mi[i] = x + 1, ma[i] = -1;
    mi[i] = min(mi[i], x + 1);
    ma[i] = max(ma[i], -1ll);
  }
  ll q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    ll t, a;
    cin >> t >> a;
    int pmi = upper_bound(begin(mi), end(mi), a) - begin(mi) - 1;
    int pma = upper_bound(begin(ma), end(ma), a, greater<ll>()) - begin(ma) - 1;
    int p = min(pmi, pma);
    int g = upper_bound(begin(r), end(r), t) - begin(r) - 1;
    ll gt = t - r[g];
    int dec = 1 - g % 2;
    int tp = pmi > pma;
    ll val;
    if (p + 1 <= g) {
      val = (tp ? rvaltop[g] : rvalbottom[g]) + (dec ? -1 : 1) * gt;
    } else {
      val = a + diff[g] + (dec ? -1 : 1) * gt;
    }
    val = min(val, x);
    val = max(val, 0ll);
    cout << val << endl;
  }
}
