#include <bits/stdc++.h>
using namespace std;
const int K = 1e5 + 5;
int r[K];
int main() {
  int x, k;
  scanf("%d %d", &x, &k);
  for (int i = 1; i <= k; ++i) {
    scanf("%d", r + i);
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int t, a;
    scanf("%d %d", &t, &a);
    int f = -1;
    int i = 1;
    for (; i <= k && r[i] < t; ++i) {
      a = a + f * (r[i] - r[i - 1]);
      if (a < 0) a = 0;
      if (a > x) a = x;
      f = -f;
    }
    a = a + f * (t - r[i - 1]);
    if (a < 0) a = 0;
    if (a > x) a = x;
    printf("%d\n", a);
  }
  return 0;
}
