#include <bits/stdc++.h>
using namespace std;
long long X, K;
long long R[100005];
long long sa[100005];
long long Q;
long long minv[100005], maxv[100005];
long long mi[100005], ma[100005];
signed main() {
  cin >> X >> K;
  for (long long i = 1; i <= K; i++) cin >> R[i];
  R[0] = 0;
  mi[0] = 0, ma[0] = X;
  minv[0] = 0, maxv[0] = X;
  sa[0] = 0;
  for (long long i = 1; i <= K; i++) {
    long long val = R[i] - R[i - 1];
    long long s = maxv[i - 1] - minv[i - 1];
    if (i % 2 == 0) {
      minv[i] = minv[i - 1] + val, maxv[i] = maxv[i - 1] + val;
      if (minv[i] > X) minv[i] = X;
      if (maxv[i] > X) maxv[i] = X;
      ma[i] = ma[i - 1] - (s - (maxv[i] - minv[i]));
      if (ma[i] < 0) ma[i] = 0;
      mi[i] = mi[i - 1];
      sa[i] += val;
    } else {
      minv[i] = minv[i - 1] - val, maxv[i] = maxv[i - 1] - val;
      if (minv[i] < 0) minv[i] = 0;
      if (maxv[i] < 0) maxv[i] = 0;
      mi[i] = mi[i - 1] + (s - (maxv[i] - minv[i]));
      if (mi[i] > X) mi[i] = X;
      ma[i] = ma[i - 1];
      sa[i] -= val;
    }
    if (mi[i] > ma[i]) mi[i] = ma[i];
  }
  K += 2;
  R[K - 1] = 1000000007;
  cin >> Q;
  while (Q--) {
    long long T, A, pos;
    long long val;
    cin >> T >> A;
    pos = upper_bound(R, R + K + 1, T) - 1 - R;
    if (mi[pos] < A && A < ma[pos]) {
      val = A + sa[pos];
    } else {
      if (mi[pos] >= A)
        val = minv[pos];
      else
        val = maxv[pos];
    }
    if (pos % 2)
      val += T - R[pos];
    else
      val -= T - R[pos];
    if (val < 0) val = 0;
    if (val > X) val = X;
    cout << val << endl;
  }
  return (0);
}
