#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, K, Q, t, a;
  int r[100001] = {};
  cin >> X >> K;
  for (int i = 1; i <= K; i++) {
    cin >> r[i];
  }
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> t >> a;
    int j = 1;
    while (j <= K && t >= r[j]) {
      if (j % 2)
        a = max(0, a - (r[j] - r[j - 1]));
      else
        a = min(X, a + (r[j] - r[j - 1]));
      j++;
    }
    if (j % 2)
      a = max(0, a - (t - r[j - 1]));
    else
      a = min(X, a + (t - r[j - 1]));
    cout << a << endl;
  }
}
