#include <bits/stdc++.h>
using namespace std;
const int mod = 1E9 + 7;
const double eps = 1e-6;
template <typename T>
T abs(T val) {
  return val > 0 ? val : -val;
}
inline int max2(int a, int b) { return ((a > b) ? a : b); }
inline int min2(int a, int b) { return ((a < b) ? a : b); }
inline int max3(int a, int b, int c) { return max2(a, max2(b, c)); }
inline int min3(int a, int b, int c) { return min2(a, min2(b, c)); }
template <class T>
inline void read(T &ret) {
  char c;
  ret = 0;
  while ((c = getchar()) < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9') ret = ret * 10 + (c - '0'), c = getchar();
}
template <class T>
inline void out(T x) {
  if (x > 9) out(x / 10);
  putchar(x % 10 + '0');
}
int X, K, a[100005], Q, t, w;
int main() {
  while (~scanf("%d%d", &X, &K)) {
    for (int i = 1; i <= K; i++) read(a[i]);
    scanf("%d", &Q);
    int it = 0, Add = 0, l = 0, r = X;
    bool flag = 0;
    while (Q--) {
      scanf("%d%d", &t, &w);
      while (it + 1 < K && a[it + 1] <= t) {
        if (flag == 0) {
          Add -= a[it + 1] - a[it];
        } else {
          Add += a[it + 1] - a[it];
        }
        if (Add < 0) {
          l -= Add;
          Add = 0;
        }
        if (Add + r - l > X) {
          r -= Add + r - l - X;
          Add = X - r + l;
        }
        if (l > r) {
          l = r = 0;
          if (Add > X) Add = X;
        }
        flag ^= 1;
        it++;
      }
      int res = t - a[it];
      if (w < l) w = l;
      if (w > r) w = r;
      w = w + Add - l;
      if (flag == 0)
        w -= res;
      else
        w += res;
      if (w < 0) w = 0;
      if (w > X) w = X;
      printf("%d\n", w);
    }
  }
}
