#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
const int N = 100005;
int r[N], t[N], a[N];
int main() {
  int x, k, qq;
  scanf("%d%d", &x, &k);
  for (int i = 0; i < (int)k; ++i) scanf("%d", &r[i]);
  r[k++] = 1e9 + 5;
  scanf("%d", &qq);
  pair<int, int> u = make_pair(x, x), l = make_pair(0, 0);
  for (int q = 0; q < (int)qq; ++q) scanf("%d%d", &t[q], &a[q]);
  int pt = 0;
  for (int i = 0, j = 0; i < k, j < qq; i++) {
    while (j < qq && t[j] <= r[i]) {
      pair<int, int> lt, ut;
      if (i & 1) {
        lt = make_pair(l.first, min(l.second + t[j] - pt, x));
        ut = make_pair(max(u.first - max(t[j] - pt - u.second, 0), l.first),
                       min(u.second + t[j] - pt, x));
      } else {
        ut = make_pair(u.first, max(u.second - t[j] + pt, 0));
        lt = make_pair(min(l.first + max(t[j] - pt - l.second, 0), u.first),
                       max(l.second - t[j] + pt, 0));
      }
      if (lt.first >= a[j])
        printf("%d\n", lt.second);
      else if (ut.first <= a[j])
        printf("%d\n", ut.second);
      else
        printf("%d\n", a[j] - lt.first + lt.second);
      j++;
    }
    pair<int, int> tl, tu;
    if (i & 1) {
      tl = make_pair(l.first, min(l.second + r[i] - pt, x));
      tu = make_pair(max(u.first - max(r[i] - pt - u.second, 0), l.first),
                     min(u.second + r[i] - pt, x));
    } else {
      tu = make_pair(u.first, max(u.second - r[i] + pt, 0));
      tl = make_pair(min(l.first + max(r[i] - pt - l.second, 0), u.first),
                     max(l.second - r[i] + pt, 0));
    }
    swap(l, tl);
    swap(u, tu);
    pt = r[i];
  }
  return 0;
}
