#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int X, K, r[N];
int Q, t, a;
int main() {
  cin >> X >> K;
  for (int i = 1; i < (K + 1); ++i) cin >> r[i];
  cin >> Q;
  int a = 0, b = X, c = 0;
  int cur = 0;
  for (int i = 0; i < (Q); ++i) {
    int t, W;
    cin >> t >> W;
    while (cur < K && r[cur + 1] <= t) {
      int duration = r[cur + 1] - r[cur];
      if (cur & 1) {
        if (a + c + duration >= X)
          a = b = X, c = 0;
        else if (b + c + duration < K)
          c += duration;
        else
          b = X - duration - c, c = X - b;
      } else {
        if (b + c - duration <= 0)
          a = b = X, c = -X;
        else if (a + c - duration > 0)
          c -= duration;
        else
          a = duration - c, c = -a;
      }
      ++cur;
    }
    int fx = 0;
    if (W <= a)
      fx = a + c;
    else if (a < W && W < b)
      fx = W + c;
    else
      fx = b + c;
    if (cur & 1)
      printf("%d\n", min(X, fx + t - r[cur]));
    else
      printf("%d\n", max(0, fx - t + r[cur]));
  }
  return 0;
}
