#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int X, n, m, r[N], sta, t;
int dfs(int x, int tot, bool flg) {
  if (t <= r[x]) {
    if (!flg)
      return ((0) > (tot - (t - r[x - 1])) ? (0) : (tot - (t - r[x - 1])));
    return ((X) < (tot + t - r[x - 1]) ? (X) : (tot + t - r[x - 1]));
  }
  if (!flg)
    return dfs(
        x + 1,
        ((0) > (tot - (r[x] - r[x - 1])) ? (0) : (tot - (r[x] - r[x - 1]))),
        flg ^ 1);
  else
    return dfs(x + 1,
               ((X) < (tot + r[x] - r[x - 1]) ? (X) : (tot + r[x] - r[x - 1])),
               flg ^ 1);
}
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", &t, &sta);
    printf("%d\n", dfs(1, sta, 0));
  }
}
int main() {
  work();
  return 0;
}
