#include <bits/stdc++.h>
const int N = 1e5 + 2;
int n, op, rev[N];
inline int nxi() {
  int x = 0;
  char c;
  while ((c = getchar()) > '9' || c < '0')
    ;
  while (x = x * 10 + c - 48, (c = getchar()) >= '0' && c <= '9')
    ;
  return x;
}
int main() {
  n = nxi(), op = nxi();
  for (int i = 1; i <= op; ++i) {
    rev[i] = nxi();
  }
  int q = nxi();
  while (q--) {
    int p = 0, nw = 0, t = nxi(), sa = nxi(), sb = n - sa;
    using std::min;
    for (int i = 1; i <= op && rev[i] < t; ++i) {
      if (nw) {
        sb -= min(sb, rev[i] - p);
        sa += min(sb, rev[i] - p);
      } else {
        sa -= min(sa, rev[i] - p);
        sb += min(sa, rev[i] - p);
      }
      p = rev[i];
      nw ^= 1;
    }
    if (nw) {
      sb -= min(sb, t - p);
      sa += min(sb, t - p);
    } else {
      sa -= min(sa, t - p);
      sb += min(sa, t - p);
    }
    printf("%d\n", sa);
  }
  return 0;
}
