#include <bits/stdc++.h>
using namespace std;
int d[100010];
int main() {
  int x, k;
  scanf("%d%d", &x, &k);
  for (int i = 1; i <= k; i++) scanf("%d", &d[i]);
  d[k + 1] = -256;
  d[0] = 0;
  int q;
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    int t, a;
    scanf("%d%d", &t, &a);
    int b = x - a;
    if (t == 0) {
      printf("%d\n", a);
      continue;
    }
    int jis = 0, beg = 0;
    while (!((d[beg] <= t && d[beg + 1] >= t) || d[beg + 1] == -256)) beg++;
    for (int i = 0; i <= beg; i++) {
      int cache = d[i + 1] - d[i];
      if (d[i + 1] > t || d[i + 1] == -256) {
        cache = t - d[i];
      }
      if (a - cache <= 0) {
        a = x;
        b = 0;
      } else
        a -= cache, b += cache, swap(a, b);
    }
    if (beg % 2 == 1)
      printf("%d\n", a);
    else
      printf("%d\n", b);
  }
  return 0;
}
