#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 17;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
map<pair<long long, long long>, int> Sx;
long long R[100050];
long long mn[100050];
long long mx[100050];
long long sum[100050];
int main() {
  int X, K, Q, i;
  scanf("%d %d", &X, &K);
  for (i = 1; i <= K; i++) scanf("%d", &R[i]);
  int st = 0, en = X, s = 0;
  mx[0] = X;
  for (i = 1; i <= K && st <= en; i++) {
    int t = R[i] - R[i - 1];
    if (i % 2 == 1) {
      s -= t;
      if (st + s <= 0) {
        int v = min(en, -s);
        Sx[pair<int, int>(st, v)] = i;
        st = v + 1;
      }
      mn[i] = max(0ll, mn[i - 1] - t);
      mx[i] = max(0ll, mx[i - 1] - t);
      sum[i] = sum[i - 1] - t;
    } else {
      s += t;
      if (en + s >= X) {
        int v = max(st, X - s);
        Sx[pair<int, int>(v, en)] = i;
        en = v - 1;
      }
      mn[i] = min((long long)X, mn[i - 1] + t);
      mx[i] = min((long long)X, mx[i - 1] + t);
      sum[i] = sum[i - 1] + t;
    }
  }
  if (st > en) Sx[pair<int, int>(st, en)] = i + 1;
  scanf("%d", &Q);
  while (Q--) {
    int t, a;
    scanf("%d %d", &t, &a);
    int p = lower_bound(R + 1, R + K + 1, t + 1) - R - 1;
    auto it = Sx.lower_bound(pair<int, int>(a + 1, 0));
    it--;
    int p2 = it->second;
    int x = 0;
    if (p < p2)
      x = a + sum[p];
    else if (p2 % 2 == 1)
      x = mn[p];
    else
      x = mx[p];
    if (p % 2 == 0)
      x = max(0ll, x - (t - R[p]));
    else
      x = min((long long)X, x + (t - R[p]));
    printf("%d\n", x);
  }
  return 0;
}
