#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
T sqr(const T &x) {
  return x * x;
}
template <class T>
T lowbit(const T &x) {
  return (x ^ (x - 1)) & x;
}
template <class T>
int countbit(const T &n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
void ckmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
void ckmax(T &a, const T &b) {
  if (b > a) a = b;
}
const int maxn = 200000 + 16;
long long total;
int n;
long long a[maxn];
long long sa[maxn];
long long st[maxn];
map<long long, int> wa;
long long f1[maxn];
long long f2[maxn];
long long solve1(int pos, long long t) {
  int at = upper_bound(st, st + n, t) - st - 1;
  long long w;
  if (pos % 2 == 1)
    w = f2[at];
  else
    w = f1[at];
  if (at % 2 == 1)
    w += (t - st[at]);
  else
    w -= (t - st[at]);
  w = max(w, 0LL);
  w = min(w, total);
  return w;
}
void simulate(long long f[], long long x) {
  for (int i = 0; i < (n); ++i) {
    f[i] = x;
    if (i % 2 == 1)
      x = min(total, x + a[i]);
    else
      x = max(0LL, x - a[i]);
  }
}
long long solve2(long long a, long long t) {
  int at = upper_bound(st, st + n, t) - st - 1;
  a += sa[at];
  if (at % 2 == 1)
    a += (t - st[at]);
  else
    a -= (t - st[at]);
  a = max(a, 0LL);
  a = min(a, total);
  return a;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> total >> n;
  for (int i = 0; i < (n); ++i) cin >> a[i];
  a[n++] = 1000000010;
  for (int i = n - 1; i > 0; i--) a[i] -= a[i - 1];
  long long s = 0;
  long long ps = 0, pt = total;
  for (int i = 0; i < (n); ++i) {
    sa[i] = s;
    if (i % 2 == 1)
      s += a[i];
    else
      s -= a[i];
    if (ps <= pt) {
      if (pt + s >= total) {
        long long e = max(ps, total - s);
        wa[e] = i;
        pt = e - 1;
      } else if (ps + s <= 0) {
        wa[ps] = i;
        ps = min(pt, -s) + 1;
      }
    }
  }
  if (ps <= pt) wa[ps] = n;
  simulate(f1, 0);
  simulate(f2, total);
  st[0] = 0;
  for (int i = 0; i < (n); ++i) st[i + 1] = st[i] + a[i];
  int nq;
  cin >> nq;
  for (int step = 0; step < (nq); ++step) {
    long long a, t;
    cin >> t >> a;
    ckmin(t, st[n] - 1);
    auto it = wa.upper_bound(a);
    if (it != wa.begin()) --it;
    int pos = it->second;
    long long ret;
    if (t >= st[pos + 1])
      ret = solve1(pos, t);
    else
      ret = solve2(a, t);
    printf("%d\n", (int)ret);
  }
  return 0;
}
