#include <bits/stdc++.h>
using namespace std;
int X, K, Q, t, a;
bool ue;
int calc_a(int diff) {
  if (ue) {
    return max(a - diff, 0);
  } else {
    return min(a + diff, X);
  }
}
int main() {
  cin >> X >> K;
  vector<int> r(K + 1);
  r[0] = 0;
  for (int(i) = (0); (i) < (K); ++(i)) {
    cin >> r[i + 1];
  }
  cin >> Q;
  for (int(i) = (0); (i) < (Q); ++(i)) {
    cin >> t >> a;
    ue = true;
    for (int(j) = (0); (j) < (K + 1); ++(j)) {
      if (r[j + 1] <= t && j < K) {
        a = calc_a(r[j + 1] - r[j]);
      } else {
        a = calc_a(t - r[j]);
        break;
      }
      ue = !ue;
    }
    cout << a << endl;
  }
  return 0;
}
