#include <bits/stdc++.h>
using namespace std;
const int MAX = 100001;
const int INF = 999999999;
int main() {
  int X, K, Q;
  int r[MAX], t[MAX], a[MAX];
  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] = INF;
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    int t, a;
    cin >> t >> a;
    bool b = true;
    for (int j = 0; r[j] < t; j++) {
      t -= r[j];
      if (b)
        a = max(0, a - r[j]);
      else
        a = min(X, a + r[j]);
      b = !b;
    }
    if (b)
      a = max(0, a - t);
    else
      a = min(X, a + t);
    cout << a << endl;
  }
  return 0;
}
