#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int x, k, r[100002], q, t[100001], a[100001];
  scanf("%d", &x);
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) scanf("%d", r + i);
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) scanf("%d %d", t + i, a + i);
  r[0] = 0;
  int pos = 1, cur1 = 0, cur2 = x;
  for (; pos <= k; pos++) {
    if (pos & 1) {
      cur1 = max(0, cur1 - (r[pos] - r[pos - 1]));
      cur2 = max(0, cur2 - (r[pos] - r[pos - 1]));
      if (cur1 <= 0 && cur2 <= 0) break;
    } else {
      cur1 = min(x, cur1 + (r[pos] - r[pos - 1]));
      cur2 = min(x, cur2 + (r[pos] - r[pos - 1]));
      if (x <= cur1 && x <= cur2) break;
    }
  }
  int absed = 200000, calced[100001] = {0};
  if (pos <= k) {
    absed = pos;
    calced[pos] = (pos & 1 ? 0 : x);
    pos++;
    for (; pos <= k; pos++) {
      if (pos & 1)
        calced[pos] = max(0, calced[pos - 1] - (r[pos] - r[pos - 1]));
      else
        calced[pos] = min(x, calced[pos - 1] + (r[pos] - r[pos - 1]));
    }
  }
  pos = 0;
  r[k + 1] = 1000000001;
  for (int i = 1; i <= q; i++) {
    while (r[pos + 1] <= t[i]) pos++;
    if (absed <= pos) {
      if (pos & 1)
        printf("%d\n", min(x, calced[pos] + (t[i] - r[pos])));
      else
        printf("%d\n", max(0, calced[pos] - (t[i] - r[pos])));
    } else {
      int cur2 = a[i];
      for (int j = 1; j <= pos; j++) {
        if (j & 1)
          cur2 = max(0, cur2 - (r[j] - r[j - 1]));
        else
          cur2 = min(x, cur2 + (r[j] - r[j - 1]));
      }
      if (pos & 1)
        printf("%d\n", min(x, cur2 + (t[i] - r[pos])));
      else
        printf("%d\n", max(0, cur2 - (t[i] - r[pos])));
    }
  }
}
