#include <bits/stdc++.h>
using namespace std;
int x, k, q, t;
int r[100005];
int d[100005];
int lu[100005], ld[100005], ru[100005], rd[100005];
int main() {
  int a, ans, nowlu, nowld, nowru, nowrd, temp = 0;
  scanf("%d", &x);
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) scanf("%d", &r[i]);
  for (int i = 1; i <= k; i++) d[i] = min(r[i] - r[i - 1], x);
  lu[0] = ru[0] = x;
  ld[0] = rd[0] = 0;
  r[k + 1] = 1000000007;
  for (int i = 1; i <= k; i++) {
    if (i % 2) {
      nowld = d[i];
      nowlu = x;
      nowrd = 0;
      nowru = x - d[i];
    } else {
      nowld = 0;
      nowlu = x - d[i];
      nowrd = d[i];
      nowru = x;
    }
    if (ru[i - 1] <= nowld || rd[i - 1] >= nowlu) {
      if (i % 2) {
        ld[i] = x;
        lu[i] = x;
        rd[i] = 0;
        ru[i] = 0;
      } else {
        ld[i] = 0;
        lu[i] = 0;
        rd[i] = x;
        ru[i] = x;
      }
    } else {
      if (rd[i - 1] <= nowld) {
        ld[i] = ld[i - 1] + nowld - rd[i - 1];
        rd[i] = nowrd;
      } else {
        ld[i] = ld[i - 1];
        rd[i] = nowrd - nowld + rd[i - 1];
      }
      if (ru[i - 1] >= nowlu) {
        lu[i] = lu[i - 1] + nowlu - ru[i - 1];
        ru[i] = nowru;
      } else {
        lu[i] = lu[i - 1];
        ru[i] = nowru - nowlu + ru[i - 1];
      }
    }
  }
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &t, &a);
    while (r[temp + 1] <= t) temp++;
    if (a >= ld[temp] && a <= lu[temp])
      ans = a - ld[temp] + rd[temp];
    else {
      if (a <= ld[temp])
        ans = rd[temp];
      else
        ans = ru[temp];
    }
    if (temp % 2)
      ans = min(x, ans + (t - r[temp]));
    else
      ans = max(0, ans - (t - r[temp]));
    printf("%d\n", ans);
  }
  return 0;
}
