#include <bits/stdc++.h>
using namespace std;
long long read_p, read_ca;
inline long long read() {
  read_p = 0;
  read_ca = getchar();
  while (read_ca < '0' || read_ca > '9') read_ca = getchar();
  while (read_ca >= '0' && read_ca <= '9')
    read_p = read_p * 10 + read_ca - 48, read_ca = getchar();
  return read_p;
}
long long n, m, X, K, T[110000], la = 0, Q, t, a, l[110000], r[110000],
                                 L[110000], R[110000];
signed main() {
  X = read();
  K = read();
  l[0] = 0;
  L[0] = 0;
  r[0] = X;
  R[0] = X;
  for (long long i = 1; i <= K; i++) {
    a = read();
    T[i] = a;
    l[i] = l[i - 1];
    r[i] = r[i - 1];
    L[i] = l[i - 1] - (a - la);
    R[i] = R[i - 1] - (a - la);
    if (L[i] <= R[i])
      if (R[i] <= 0) {
        l[i] = 0;
        L[i] = X;
        r[i] = 0;
        R[i] = X;
      } else {
        if (L[i] < 0) l[i] -= L[i], L[i] = 0;
        L[i] = X - L[i];
        R[i] = X - R[i];
      }
    else if (L[i] <= 0) {
      l[i] = 0;
      L[i] = X;
      r[i] = 0;
      R[i] = X;
    } else {
      if (R[i] < 0) r[i] += R[i], R[i] = 0;
      L[i] = X - L[i];
      R[i] = X - R[i];
    }
    la = a;
  }
  Q = read();
  for (long long i = 1; i <= Q; i++) {
    t = read();
    a = read();
    long long _l = 0, _r = K, mid;
    while (_l < _r) {
      if (T[mid = _l + _r + 1 >> 1] <= t)
        _l = mid;
      else
        _r = mid - 1;
    }
    t -= T[_l];
    if (a <= l[_l])
      a = L[_l];
    else if (a >= r[_l])
      a = R[_l];
    else if (L[_l] == R[_l])
      a = L[_l];
    else if (L[_l] < R[_l])
      a = L[_l] + (a - l[_l]);
    else
      a = L[_l] - (a - l[_l]);
    a -= t;
    if (a < 0) a = 0;
    if (_l & 1) a = X - a;
    printf("%lld\n", a);
  }
}
