#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, K, Q;
  int r[100010];
  cin >> X;
  cin >> K;
  for (int i = 0; i < K; i++) cin >> r[i];
  cin >> Q;
  int x, y, z;
  int t, a;
  int tim = 0, dir = 1, rin = 0;
  x = 0;
  y = X;
  z = 0;
  for (int i = 0; i < Q; i++) {
    cin >> t >> a;
    for (int j = tim; j < t; j++) {
      if (j == r[rin]) {
        dir = 1 - dir;
        rin++;
      }
      if (dir == 1) {
        z = max(z - 1, -X);
        x = max(x, -z);
        y = max(x, y);
      } else {
        z = min(z + 1, X);
        y = min(y, X - z);
        x = min(x, y);
      }
    }
    tim = t;
    if (a <= x)
      cout << max(0, min(x + z, X)) << endl;
    else if (a >= y)
      cout << max(0, min(y + z, X)) << endl;
    else
      cout << max(0, min(a + z, X)) << endl;
  }
  return 0;
}
