#include <bits/stdc++.h>
using namespace std;
int X, N, Q;
int r[100005], q[100005], a[100005];
int L, R;
int cal(int x) {
  x = max(L, x);
  x = min(R, x);
  return x;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> X >> N;
  for (int i = 1; i <= N; i++) cin >> r[i];
  cin >> Q;
  for (int i = 1; i <= Q; i++) {
    cin >> q[i] >> a[i];
  }
  int k = 1, b = 0;
  int p = 0, t = 0;
  L = 0, R = X;
  for (int i = 1; i <= Q; i++) {
    while (p + 1 <= N && r[p + 1] <= q[i]) {
      ++p;
      b -= r[p] - t;
      if (k == 1)
        L = max(L, abs(b));
      else
        R = min(R, abs(b));
      b = X - b;
      k *= -1;
      t = r[p];
    }
    b -= q[i] - t;
    t = q[i];
    if (k == 1)
      L = max(L, min(N, abs(b)));
    else
      R = min(R, abs(b));
    if (L > R) {
      if (k == -1)
        cout << X << endl;
      else
        cout << "0" << endl;
    } else {
      int ans = k * cal(a[i]) + b;
      ans = min(X, max(0, ans));
      if (k == 1)
        cout << ans << endl;
      else
        cout << X - ans << endl;
    }
  }
  return 0;
}
