#include <bits/stdc++.h>
using namespace std;
struct QUERY {
  int t, a;
};
int b[] = {-1, 1};
int main() {
  long long X, K;
  cin >> X >> K;
  vector<int> r(K + 1);
  vector<int> ruiseki(K + 1);
  for (int i = 1; i <= K; i++) {
    cin >> r[i];
    ruiseki[i] = ruiseki[i - 1] + b[(i + 1) % 2] * (r[i] - r[i - 1]);
  }
  int Q;
  cin >> Q;
  vector<QUERY> query(Q);
  for (int i = 0; i < Q; i++) {
    cin >> query[i].t >> query[i].a;
  }
  int r_index = 0;
  for (int i = 0; i < Q; i++) {
    while (r_index < K && query[i].t > r[r_index + 1]) {
      r_index++;
    }
    long long bias = 0;
    for (int j = 1; j <= r_index; j++) {
      long long a = query[i].a + ruiseki[j] + bias;
      if (a > X) {
        bias = X - a;
      } else if (a < 0) {
        bias = -a;
      }
    }
    long long ans = query[i].a + ruiseki[r_index] + bias +
                    b[r_index % 2] * (query[i].t - r[r_index]);
    ans = max((long long)0, min(X, ans));
    cout << ans << endl;
  }
  return 0;
}
