#include <bits/stdc++.h>
using namespace std;
const int MC = 100010;
int X, K, Q;
int r[MC];
int t[MC], a[MC];
int st[MC];
int amin, amax;
int ans[MC];
int main() {
  scanf("%d%d", &X, &K);
  for (int i = (int)(1); i < (int)(K + 1); ++i) {
    scanf("%d", r + i);
  }
  scanf("%d", &Q);
  for (int i = (int)(0); i < (int)(Q); ++i) {
    scanf("%d%d", t + i, a + i);
    st[i] = i;
  }
  sort(st, st + Q, [&](const int p, const int q) { return t[p] < t[q]; });
  amin = 0;
  amax = X;
  int pt = 0;
  long long sum = 0;
  for (int i = (int)(0); i < (int)(K); ++i) {
    int z = (i % 2 ? 1 : -1);
    while (pt < Q && t[st[pt]] < r[i + 1]) {
      a[st[pt]] = max((long long)0,
                      min((long long)X, max(amin, min(amax, a[st[pt]])) + sum));
      ans[st[pt]] = max(0, min(X, a[st[pt]] + z * (t[st[pt]] - r[i])));
      ++pt;
    }
    sum += z * (r[i + 1] - r[i]);
    amin = max((long long)amin, min((long long)X, -sum));
    amax = min((long long)amax, max((long long)0, X - sum));
  }
  int z = (K % 2 ? 1 : -1);
  while (pt < Q) {
    a[st[pt]] = max((long long)0,
                    min((long long)X, max(amin, min(amax, a[st[pt]])) + sum));
    ans[st[pt]] = max(0, min(X, a[st[pt]] + z * (t[st[pt]] - r[K])));
    ++pt;
  }
  for (int i = (int)(0); i < (int)(Q); ++i) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
