#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long X, K;
  cin >> X >> K;
  int r[100002];
  for (int i = 1; i <= (K); i++) cin >> r[i];
  r[0] = 0;
  r[K + 1] = 2e9;
  long long L = 0;
  long long R = X;
  long long takasa = 0;
  int katamuki = -1;
  int *ri = r + 1;
  int Q;
  cin >> Q;
  for (int i = 0; i < (Q); i++) {
    long long t, a;
    cin >> t >> a;
    while (t > *ri) {
      takasa += katamuki * (*ri - *(ri - 1));
      long long nl = takasa + L;
      long long nr = takasa + R;
      if (takasa < 0) {
        if (nl < 0) L -= nl;
        if (nr < 0) R -= nr;
      } else {
        if (nl > X) L -= nl - X;
        if (nr > X) R -= nr - X;
      }
      ri++;
      katamuki *= -1;
    }
    a = max(a, L);
    a = min(a, R);
    a += takasa + katamuki * (t - *(ri - 1));
    a = max(a, 0ll);
    a = min(a, X);
    cout << (a) << "\n";
  }
  return 0;
}
