#include <bits/stdc++.h>
int mymax(int x, int y) {
  if (x > y) {
    return x;
  } else {
    return y;
  }
}
int action(int x, int k, int* r, int t, int a) {
  int i;
  int highest = k;
  int lowest = 0;
  if (r[k] < t) {
    lowest = k;
  } else {
    while (highest > lowest + 1) {
      int mid = (highest + lowest) / 2;
      if (r[mid] > t) {
        highest = mid;
      } else {
        lowest = mid;
      }
    }
  }
  int r_last = lowest;
  int up = a;
  int down = x - a;
  for (i = 1; i <= r_last; i++) {
    int time = r[i] - r[i - 1];
    down = mymax(up - time, 0);
    up = x - down;
  }
  up = mymax(up - (t - r[r_last]), 0);
  down = x - up;
  if (r_last % 2 == 0) {
    return up;
  } else {
    return down;
  }
}
int main() {
  int x, k, q, j;
  scanf("%d", &x);
  scanf("%d", &k);
  int r[100010] = {};
  for (j = 1; j < k + 1; j++) {
    scanf("%d", &r[j]);
  }
  scanf("%d", &q);
  int t, a;
  for (j = 1; j < q + 1; j++) {
    scanf("%d %d", &t, &a);
    int ans = action(x, k, r, t, a);
    printf("%d\n", ans);
  }
  return 0;
}
