#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int X, n, m, r[N], t, f[N], last = 0, lt = 0, fg = 0;
inline int dfs(int x, register int tot, bool flg) {
  if (t <= r[x] || x == n + 1) {
    lt = tot;
    last = x;
    fg = flg;
    if (!flg) return ((0) > (tot - t + r[x - 1]) ? (0) : (tot - t + r[x - 1]));
    return ((X) < (tot - r[x - 1] + t) ? (X) : (tot - r[x - 1] + t));
  }
  if (f[x] == tot) return dfs(last, lt, fg);
  f[x] = tot;
  int nxt;
  if (!flg)
    nxt = tot - r[x] + r[x - 1];
  else
    nxt = tot + r[x] - r[x - 1];
  if (nxt < 0) nxt = 0;
  if (nxt > X) nxt = X;
  return dfs(x + 1, nxt, flg ^ 1);
}
struct node {
  int sta, t;
  bool operator<(const node &pp) const { return t < pp.t; }
} q[N];
void work() {
  scanf("%d%d", &X, &n);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &q[i].t, &q[i].sta);
  }
  memset(f, -1, sizeof(f));
  sort(q + 1, q + m + 1);
  int lim = 1e5;
  for (int i = 1; i <= m; i++) {
    t = q[i].t;
    if (q[i].t - q[i - 1].t <= lim)
      printf("%d\n", dfs(1, q[i].sta, 0));
    else {
      printf("%d\n", dfs(last, lt, fg));
    }
  }
}
int main() {
  work();
  return 0;
}
