#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
long long x, k, q;
long long r[100001], t[100000], a[100000];
long long v[100001], mi[100001], ma[100001], imi[100001], ima[100001];
int main(int argc, char **argv) {
  cin >> x >> k;
  r[0] = 0;
  for (int i = 0; i < (int)k; ++i) cin >> r[i + 1];
  cin >> q;
  for (int i = 0; i < (int)q; ++i) cin >> t[i] >> a[i];
  v[0] = mi[0] = ma[0] = 0;
  for (int i = 0; i < (int)k; ++i) {
    if (i % 2 == 0)
      v[i + 1] = v[i] - (r[i + 1] - r[i]);
    else
      v[i + 1] = v[i] + (r[i + 1] - r[i]);
    if (v[i + 1] <= mi[i])
      imi[i + 1] = i + 1;
    else
      imi[i + 1] = imi[i];
    mi[i + 1] = v[imi[i + 1]];
    if (v[i + 1] >= ma[i])
      ima[i + 1] = i + 1;
    else
      ima[i + 1] = ima[i];
    ma[i + 1] = v[ima[i + 1]];
    if (ma[i + 1] - mi[i + 1] > x) {
      if (i % 2 == 0) {
        v[i + 1] = ma[i + 1] - x;
        mi[i + 1] = v[i + 1];
        imi[i + 1] = i + 1;
      } else {
        v[i + 1] = mi[i + 1] + x;
        ma[i + 1] = v[i + 1];
        imi[i + 1] = i + 1;
      }
    }
  }
  for (int i = 0; i < (int)q; ++i) {
    int ti = upper_bound(r, r + k + 1, t[i]) - r - 1;
    long long l = t[i] - r[ti];
    if (ti % 2 == 0) l *= -1;
    long long res = a[i] + v[ti] + l;
    if (a[i] + mi[ti] >= 0 && a[i] + ma[ti] <= x) {
    } else if (a[i] + mi[ti] < 0 &&
               (a[i] + ma[ti] <= x || ima[ti] <= imi[ti])) {
      res -= a[i] + mi[ti];
    } else {
      res -= a[i] + ma[ti] - x;
    }
    res = min(res, x);
    res = max(res, (long long)0);
    cout << res << endl;
  }
  return 0;
}
