#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 10;
struct node {
  int t, a, id;
  bool operator<(const node &rhs) const { return t < rhs.t; }
} Query[N];
int ans[N], r[N];
inline int read() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') flag = -1, ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch - '0'), ch = getchar();
  return x * flag;
}
int main() {
  int X = read(), n = read();
  for (int i = (1), iend = (n); i <= iend; i++) r[i] = read();
  int q = read();
  for (int i = (1), iend = (q); i <= iend; i++) {
    int t = read(), a = read();
    Query[i] = (node){t, a, i};
  }
  sort(Query + 1, Query + q + 1);
  int DivPosl = 0, DivPosr = X, Sign = -1, val = 0, id = 0, Delta = 0;
  bool flag = 0;
  r[++n] = INF;
  for (int i = (1), iend = (n); i <= iend; i++) {
    while (Query[id + 1].t <= r[i] && id < q) {
      node cur = Query[++id];
      int T = cur.t - r[i - 1];
      if (!flag)
        ans[cur.id] = val + min(max(DivPosl, cur.a), DivPosr) + Sign * T;
      else
        ans[cur.id] = val + Sign * T;
      chkmax(ans[cur.id], 0), chkmin(ans[cur.id], X);
    }
    val += Sign * (r[i] - r[i - 1]), Delta += Sign * (r[i] - r[i - 1]);
    if (Sign == -1) chkmax(DivPosl, -Delta);
    if (Sign == 1) chkmin(DivPosr, X - Delta);
    if (DivPosl > DivPosr) {
      if (flag)
        val = min(max(0, val + Sign * (r[i] - r[i - 1])), X);
      else {
        if (Sign == 1)
          val = X;
        else
          val = 0;
      }
      flag = true;
    }
    Sign = -Sign;
  }
  for (int i = (1), iend = (q); i <= iend; i++) printf("%d\n", ans[i]);
  return 0;
}
