#include <bits/stdc++.h>
using namespace std;
long long a[100010];
long long w[100010];
long long gap[100010];
long long seg[400000];
long long dp[100010];
long long dp1[100010];
long long update(long long pos, long long val, long long node, long long x,
                 long long y) {
  if (pos < x || y < pos) return seg[node];
  if (x == y) return seg[node] += val;
  long long mid = (x + y) / 2;
  return seg[node] = update(pos, val, node * 2, x, mid) +
                     update(pos, val, node * 2 + 1, mid + 1, y);
}
long long query(long long lo, long long hi, long long node, long long x,
                long long y) {
  if (hi < x || y < lo) return 0;
  if (lo <= x && y <= hi) return seg[node];
  long long mid = (x + y) / 2;
  return query(lo, hi, node * 2, x, mid) +
         query(lo, hi, node * 2 + 1, mid + 1, y);
}
int main() {
  long long n, m;
  scanf("%lld %lld", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
  }
  m++;
  int ch = -1;
  long long x = -1234567890;
  long long y = 1234567890;
  dp[0] = x;
  dp1[0] = x;
  a[m] = y;
  dp[m] = y;
  dp1[m] = y;
  for (int i = 1; i <= m; i++) {
    gap[i] = (min(a[i] - a[i - 1], n)) * ch;
    ch *= -1;
    update(i, gap[i], 1, 1, m);
    gap[i] += gap[i - 1];
    x = max(gap[i], x);
    y = min(y, gap[i]);
    dp[i] = x;
    dp1[i] = y;
    dp1[i] = -dp1[i];
  }
  long long q;
  scanf("%lld", &q);
  for (int i = 1; i <= q; i++) {
    long long dap = 0;
    long long w, e;
    scanf("%lld %lld", &w, &e);
    int t = upper_bound(dp1, dp1 + m + 1, e) - dp1;
    int o = upper_bound(dp, dp + 1 + m, n - e) - dp;
    int ch = upper_bound(a, a + m + 1, w) - a;
    if (min(t, o) <= ch) {
      ch--;
      int xx = 0;
      if (t < o)
        xx = t;
      else {
        xx = o;
        dap = n;
      }
      if (xx + 1 <= ch) dap += query(xx + 1, ch, 1, 1, m);
      w = w - a[ch];
      if (ch % 2)
        dap += w;
      else
        dap -= w;
      dap = max((long long)0, dap);
      dap = min(dap, n);
      printf("%lld\n", dap);
    } else {
      dap = e;
      ch--;
      dap += gap[ch];
      w = w - a[ch];
      if (ch % 2)
        dap += w;
      else
        dap -= w;
      dap = max((long long)0, dap);
      dap = min(dap, n);
      printf("%lld\n", dap);
    }
  }
}
