#include <bits/stdc++.h>
const int N = 100100;
const int mod = 1e9 + 7;
using namespace std;
int inf = 2e9;
int n;
int X;
int R[N];
int r[N];
int s[N];
int L[N];
int nxt[N][20];
int t[2][2][N][20];
int get(int A, int B, int l, int r) {
  int g = L[r - l + 1];
  return max(t[A][B][l][g], t[A][B][r - (1 << g) + 1][g]);
}
int solve(int i, int a) {
  int l = i, r = n + 1;
  while (l < r) {
    int m = (l + r) / 2;
    if (get(i & 1, 0, i, m) >= a + (s[i] * (i & 1 ? -1 : 1))) {
      r = m;
    } else if (get(i & 1, 1, i, m) >= X - a - (s[i] * (i & 1 ? 1 : -1))) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> X >> n;
  for (int i = 1; i <= n; i++) {
    cin >> R[i];
    r[i] = R[i] - R[i - 1];
  }
  for (int i = 2; i <= n + 1; i++) {
    s[i] = s[i - 1] + r[i - 1] * (i % 2 ? -1 : 1);
  }
  for (int i = 2; i < N; i++) {
    L[i] = L[i / 2] + 1;
  }
  for (int A = 0; A < 2; A++) {
    for (int B = 0; B < 2; B++) {
      for (int i = 1; i <= n; i++) {
        if ((i & 1) == A) {
          if (B == 0) {
            t[A][B][i][0] = r[i] + (s[i] * (A ? -1 : 1));
          } else {
            t[A][B][i][0] = -inf;
          }
        } else {
          if (B == 1) {
            t[A][B][i][0] = r[i] - (s[i] * (A ? 1 : -1));
          } else {
            t[A][B][i][0] = -inf;
          }
        }
      }
      for (int j = 1; j < 20; j++) {
        for (int i = 1; i <= n; i++)
          if (i + (1 << j) - 1 <= n) {
            t[A][B][i][j] =
                max(t[A][B][i][j - 1], t[A][B][i + (1 << j - 1)][j - 1]);
          }
      }
    }
  }
  R[n + 1] = inf;
  for (int i = 0; i < 20; i++) {
    nxt[n + 1][i] = nxt[n + 2][i] = n + 1;
  }
  for (int i = n; i >= 1; i--) {
    nxt[i][0] = solve(i, X);
  }
  for (int j = 1; j < 20; j++) {
    for (int i = 1; i <= n; i++) {
      nxt[i][j] = nxt[nxt[i][j - 1] + 1][j - 1];
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int t, a;
    cin >> t >> a;
    int i = solve(1, a);
    if (t <= R[i]) {
      int j = lower_bound(R, R + n + 2, t + 1) - R - 1;
      if (j & 1) {
        a = a - s[j + 1];
      } else {
        a = X - a + s[j + 1];
      }
      a = max(0, X - a - (t - R[j]));
      cout << (j & 1 ? X - a : a) << "\n";
      continue;
    }
    a = X;
    for (int j = 19; j >= 0; j--) {
      if (R[nxt[i + 1][j]] <= t) {
        i = nxt[i + 1][j];
      }
    }
    int j = lower_bound(R, R + n + 2, t + 1) - R - 1;
    int dif = (s[j + 1] - s[i + 1]) * (i & 1 ? -1 : 1);
    if (j % 2 == (i + 1) % 2) {
      a = a - dif;
    } else {
      a = X - a + dif;
    }
    a = max(0, X - a - (t - R[j]));
    cout << (j & 1 ? X - a : a) << "\n";
  }
}
