#include <bits/stdc++.h>
using namespace std;
int K[100005];
int n, m, T, k, X, Q, a, t;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch <= '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
int main() {
  X = read();
  k = read();
  for (int i = 1; i <= k; i++) {
    K[i] = read();
  }
  K[0] = 0;
  Q = read();
  for (int i = 0; i < Q; i++) {
    t = read();
    a = read();
    int L = a, R = X - L;
    int cnt = 1;
    int F = -1;
    int pass = 0;
    while (cnt <= k && K[cnt] <= t) {
      L += (K[cnt] - K[cnt - 1]) * F;
      R -= (K[cnt] - K[cnt - 1]) * F;
      if (L < 0) {
        L = 0;
      }
      if (L > X) {
        L = X;
      }
      if (R < 0) {
        R = 0;
      }
      if (R > X) {
        R = X;
      }
      pass += (K[cnt] - K[cnt - 1]);
      F *= -1;
      cnt++;
    }
    if (pass < t) {
      L += (t - pass) * F;
      R -= (t - pass) * F;
      if (L < 0) {
        L = 0;
      }
      if (L > X) {
        L = X;
      }
      if (R < 0) {
        R = 0;
      }
      if (R > X) {
        R = X;
      }
    }
    printf("%d\n", L);
  }
  return 0;
}
