#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005][3];
int main() {
  int n, i, t, x, c;
  scanf("%d %d", &x, &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d %d", &t, &c);
    int k = 0, u = 0, d = x, v = 0, s = 0;
    while (k < n && a[k + 1] <= t) {
      if (k % 2 == 0) {
        u = u - (a[k + 1] - v);
        d = d - (a[k + 1] - v);
        s = s - (a[k + 1] - v);
      } else {
        u = u + (a[k + 1] - v);
        d = d + (a[k + 1] - v);
        s = s + a[k + 1] - v;
      }
      u = max(0, min(u, x));
      d = max(0, min(d, x));
      v = a[k + 1];
      k++;
    }
    int a1, ans;
    a1 = max(u, min(d, c + s));
    if ((k) % 2 == 0) {
      ans = max(0, min(x, a1 - (t - v)));
    } else {
      ans = max(0, min(x, a1 + t - v));
    }
    printf("%d\n", ans);
  }
  return 0;
}
