#include <bits/stdc++.h>
using namespace std;
int r[200000];
int X, K;
int main() {
  int Q, T, A, minA, maxA, k = 0, t = 0, x = 0;
  cin >> X >> K;
  for (int i = 0; i < K; i++) {
    cin >> r[i];
  }
  for (int i = K - 1; i > 0; i--) {
    r[i] -= r[i - 1];
  }
  r[K] = 1000000000;
  maxA = X;
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> T >> A;
    if (A < minA) {
      A = minA + x;
    } else if (A > maxA) {
      A = maxA + x;
    } else {
      A += x;
    }
    T -= t;
    for (; T >= r[k];) {
      if (k % 2 == 0) {
        A = max(0, A - r[k]);
        x -= r[k];
        minA = max(minA, -x);
      } else {
        A = min(X, A + r[k]);
        x += r[k];
        maxA = min(maxA, X - x);
      }
      t += r[k];
      T -= r[k];
      k++;
    }
    if (k % 2 == 0) {
      A = max(0, A - T);
    } else {
      A = min(X, A + T);
    }
    cout << A << endl;
  }
  return 0;
}
