#include <bits/stdc++.h>
using namespace std;
const long long INF = LONG_MAX;
const double EPS = 0.00001;
const long double PI = acos(-1.0);
const long long MAX_N = 1e5;
long long bit[MAX_N + 1], n;
long long sum(long long i) {
  long long s = 0;
  while (i > 0) {
    s += bit[i];
    i -= i & -i;
  }
  return s;
}
long long add(long long i, long long x) {
  while (i <= n) {
    bit[i] += x;
    i += i & -i;
  }
  return 0;
}
int main() {
  long long X, K, Q;
  cin >> X >> K;
  n = K;
  vector<long long> r(K), dr(K);
  for (long long i = (0); i < (K); ++i) cin >> r[i];
  cin >> Q;
  memset((bit), 0, sizeof(bit));
  dr[0] = r[0];
  for (long long i = (0); i < (K - 1); ++i) {
    dr[i + 1] = r[i + 1] - r[i];
  }
  for (long long i = (0); i < (K); ++i) add(i + 1, dr[i]);
  vector<long long> res(K);
  res[0] = X;
  for (long long i = (1); i < (K); ++i) {
    res[i] = X - max(0LL, (res[i - 1] - dr[i]));
  }
  for (long long i = (0); i < (Q); ++i) {
    long long t, a;
    cin >> t >> a;
    auto itr = lower_bound(r.begin(), r.end(), t);
    int pos = itr - r.begin();
    long long ue = a;
    if (pos == 0) {
      ue = max(0LL, ue - t);
      if (pos % 2)
        cout << X - ue << endl;
      else
        cout << ue << endl;
    } else {
      if (a <= r[0]) {
        ue = res[pos - 1];
      } else {
        for (long long j = (0); j < (pos); ++j) {
          ue = max(0LL, ue - dr[j]);
          ue = X - ue;
        }
      }
      t -= r[pos - 1];
      ue = max(0LL, ue - t);
      if (pos % 2)
        cout << X - ue << endl;
      else
        cout << ue << endl;
    }
  }
  return 0;
}
