#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void debug_cerr() { cerr << '\n'; }
template <class Head, class... Tail>
void debug_cerr(Head head, Tail... tail) {
  cerr << ' ' << head;
  debug_cerr(tail...);
}
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;
constexpr int inf = 1 << 30;
constexpr int mx = 100000;
int X, K, Q, pos;
int T[mx + 2];
int lx[mx + 1];
int ly[mx + 1];
int rx[mx + 1];
int ry[mx + 1];
int main() {
  cin >> X >> K;
  for (int i = (1); i <= (K); ++i) cin >> T[i];
  T[K + 1] = inf;
  rx[0] = ry[0] = X;
  for (int i = (1); i <= (K); ++i) {
    lx[i] = lx[i - 1];
    rx[i] = rx[i - 1];
    if (i & 1) {
      ly[i] = ly[i - 1] + T[i - 1] - T[i];
      ry[i] = ry[i - 1] + T[i - 1] - T[i];
      if (ly[i] < 0 && ry[i] < 0) {
        lx[i] = ly[i] = rx[i] = ry[i] = 0;
      } else if (ly[i] < 0) {
        lx[i] -= ly[i];
        ly[i] = 0;
      }
    } else {
      ly[i] = ly[i - 1] + T[i] - T[i - 1];
      ry[i] = ry[i - 1] + T[i] - T[i - 1];
      if (ly[i] > X && ry[i] > X) {
        lx[i] = ly[i] = rx[i] = ry[i] = 0;
      } else if (ry[i] > X) {
        rx[i] -= ry[i] - X;
        ry[i] = X;
      }
    }
  }
  cin >> Q;
  while (Q--) {
    int t, a;
    cin >> t >> a;
    while (T[pos + 1] <= t) pos++;
    int ans, dif = t - T[pos];
    if (a <= lx[pos])
      ans = ly[pos];
    else if (a >= rx[pos])
      ans = ry[pos];
    else
      ans = ly[pos] + (a - lx[pos]);
    if (pos & 1)
      cout << min(ans + dif, X) << '\n';
    else
      cout << max(ans - dif, 0) << '\n';
  }
}
