#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[maxn];
int main() {
  int i, j, X, K, Q;
  scanf("%d%d", &X, &K);
  for (i = 1; i <= K; i++) scanf("%d", &a[i]);
  int L, R = X;
  int cnt = 0, k = 0, s = -1, x = 0, ans, num;
  int t, A, sum;
  scanf("%d", &Q);
  for (i = 1; i <= Q; i++) {
    cnt = 0, k = 0, s = -1, x = 0;
    scanf("%d%d", &t, &A);
    L = A, R = X - A;
    while (k < K && a[k + 1] <= t) {
      ans = s * (a[k + 1] - cnt);
      L = max(0, min(X, L + ans));
      R = max(0, min(X, R - ans));
      cnt = a[k + 1];
      s = -s;
      x += ans;
      k++;
    }
    num = t - cnt;
    if (s == 1) {
      if (num > R)
        sum = X;
      else
        sum = L + num;
    } else {
      if (num > L)
        sum = 0;
      else
        sum = L - num;
    }
    printf("%d\n", sum);
  }
  return 0;
}
