#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template <class T = int>
using V = vector<T>;
template <class T = int>
using VV = V<V<T> >;
template <class T>
void assign(V<T>& v, int n, const T& a = T()) {
  v.assign(n, a);
}
template <class T, class... U>
void assign(V<T>& v, int n, const U&... u) {
  v.resize(n);
  for (auto&& i : v) assign(i, u...);
}
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int x, k;
  cin >> x >> k;
  V<> r(k + 2);
  for (int i = 0; i < k; i++) cin >> r[i + 1];
  r[k + 1] = 2e9;
  V<> l(k + 2), u(k + 2), la(k + 2), ua(k + 2);
  u[0] = ua[0] = x;
  for (int i = 1; i < k + 2; i++) {
    la[i] = la[i - 1], ua[i] = ua[i - 1];
    if (i & 1) {
      u[i] = max(u[i - 1] - (r[i] - r[i - 1]), 0);
      l[i] = max(l[i - 1] - (r[i] - r[i - 1]), 0);
      if (r[i] - r[i - 1] > l[i - 1])
        la[i] = min(la[i] + r[i] - r[i - 1] - l[i - 1], x);
    } else {
      u[i] = min(u[i - 1] + r[i] - r[i - 1], x);
      l[i] = min(l[i - 1] + r[i] - r[i - 1], x);
      if (r[i] - r[i - 1] > x - u[i - 1])
        ua[i] = max(ua[i] - (r[i] - r[i - 1] - (x - ua[i - 1])), 0);
    }
  }
  int q;
  cin >> q;
  int p = 0;
  for (int iq = 0; iq < q; iq++) {
    int t, a;
    cin >> t >> a;
    while (r[p + 1] <= t) p++;
    int res;
    if (a <= la[p])
      res = l[p];
    else if (a >= ua[p])
      res = u[p];
    else if (p & 1)
      res = l[p] + a - la[p];
    else
      res = u[p] - (ua[p] - a);
    cout << min(max(res + (p & 1 ? t - r[p] : r[p] - t), 0), x) << '\n';
  }
}
