#include <bits/stdc++.h>
using namespace std;
int x, k, r[1000100], q, t, o, p, A, i, ans[1000100], j;
set<pair<int, int> > a[1000100];
int main() {
  scanf("%d", &x);
  scanf("%d", &k);
  for (i = 1; i <= k; i++) {
    scanf("%d", &r[i]);
  }
  r[k + 1] = 2000000000;
  scanf("%d", &q);
  for (i = 1; i <= q; i++) {
    scanf("%d%d", &t, &o);
    A = o;
    for (j = 1;; j++) {
      if (t < r[j]) {
        if (j % 2)
          A = max(0, A - t + r[j - 1]);
        else
          A = min(x, A + t - r[j - 1]);
        ans[i] = A;
        break;
      }
      if (j % 2) {
        A = max(0, A - r[j] + r[j - 1]);
        if (A == 0) {
          a[j].insert(make_pair(t, i));
          break;
        }
      } else {
        A = min(x, A + r[j] - r[j - 1]);
        if (A == x) {
          a[j].insert(make_pair(t, i));
          break;
        }
      }
    }
  }
  for (i = 1; i <= k; i++) {
    if (a[i].empty() == false) {
      if (i % 2)
        A = 0;
      else
        A = x;
      set<pair<int, int> >::iterator o = a[i].begin();
      for (j = i + 1; o != a[i].end(); j++) {
        for (; (*o).first < r[j] && o != a[i].end(); o++) {
          if (j % 2)
            ans[(*o).second] = max(0, A - (*o).first + r[j - 1]);
          else
            ans[(*o).second] = min(x, A + (*o).first - r[j - 1]);
        }
        if (j % 2)
          A = max(0, A - r[j] + r[j - 1]);
        else
          A = min(x, A + r[j] - r[j - 1]);
      }
    }
  }
  for (i = 1; i <= q; i++) {
    printf("%d\n", ans[i]);
  }
}
