#include <bits/stdc++.h>
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long min(long long a, long long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}
signed main() {
  long long X, K, Q, i;
  scanf("%lld%lld", &X, &K);
  long long *r = (long long *)malloc(sizeof(long long) * (K + 1));
  r[0] = 0;
  for (i = 1; i <= K; i++) {
    scanf("%lld", &r[i]);
  }
  scanf("%lld", &Q);
  long long *t = (long long *)malloc(sizeof(long long) * Q);
  long long *a = (long long *)malloc(sizeof(long long) * Q);
  for (i = 0; i < Q; i++) {
    scanf("%lld%lld", &t[i], &a[i]);
  }
  long long *termsd = (long long *)malloc(sizeof(long long) * (K + 1));
  long long *termsu = (long long *)malloc(sizeof(long long) * (K + 1));
  long long *Ad = (long long *)malloc(sizeof(long long) * (K + 1));
  long long *An = (long long *)malloc(sizeof(long long) * (K + 1));
  long long *Au = (long long *)malloc(sizeof(long long) * (K + 1));
  termsd[0] = 0;
  termsu[0] = X;
  Ad[0] = 0;
  An[0] = 0;
  Au[0] = X;
  for (i = 1; i <= K; i++) {
    if (i % 2 == 1) {
      Ad[i] = max(0, Ad[i - 1] + r[i - 1] - r[i]);
      An[i] = An[i - 1] + r[i - 1] - r[i];
      Au[i] = min(X, Au[i - 1] + r[i - 1] - r[i]);
      termsd[i] = max(termsd[i - 1], -An[i]);
      termsu[i] = min(termsu[i - 1], X - An[i]);
    } else {
      Ad[i] = max(0, Ad[i - 1] - r[i - 1] + r[i]);
      An[i] = An[i - 1] - r[i - 1] + r[i];
      Au[i] = min(X, Au[i - 1] - r[i - 1] + r[i]);
      termsd[i] = max(termsd[i - 1], -An[i]);
      termsu[i] = min(termsu[i - 1], X - An[i]);
    }
  }
  long long left, half, right;
  for (i = 0; i < Q; i++) {
    left = 0;
    right = K + 1;
    while (right - left > 1) {
      half = (left + right) / 2;
      if (r[half] < t[i]) {
        left = half;
      } else {
        right = half;
      }
    }
    if (left % 2 == 0) {
      if (a[i] <= termsd[left]) {
        printf("%lld\n", max(0, Ad[left] + r[left] - t[i]));
      } else if (a[i] < termsu[left]) {
        printf("%lld\n", max(0, a[i] + An[left] + r[left] - t[i]));
      } else {
        printf("%lld\n", max(0, Au[left] + r[left] - t[i]));
      }
    } else {
      if (a[i] <= termsd[left]) {
        printf("%lld\n", min(X, Ad[left] - r[left] + t[i]));
      } else if (a[i] < termsu[left]) {
        printf("%lld\n", min(X, a[i] + An[left] - r[left] + t[i]));
      } else {
        printf("%lld\n", min(X, Au[left] - r[left] + t[i]));
      }
    }
  }
  return 0;
}
