#include <bits/stdc++.h>
using namespace std;
const int INF = (1LL << 30);
const long long LLINF = (1LL << 60);
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;
template <typename T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <typename T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int r[100010], t[100010], A[100010];
signed main(void) {
  int x, k;
  cin >> x >> k;
  for (long long i = (long long)0; i < (long long)k; ++i) cin >> r[i];
  int q;
  cin >> q;
  for (long long i = (long long)0; i < (long long)q; ++i) cin >> t[i] >> A[i];
  int idx = 0, a = 0, b = 0, c = x, pre = 0;
  for (long long i = (long long)0; i < (long long)k; ++i) {
    while (idx < q && t[idx] <= r[i]) {
      if (i % 2 == 0) {
        if (a >= t[idx] - pre)
          a -= t[idx] - pre;
        else {
          b += (t[idx] - pre) - a;
          chmin(b, c);
          a = 0;
        }
      } else {
        if (a + c - b + t[idx] - pre <= x)
          a += t[idx] - pre;
        else {
          int tmp = (t[idx] - pre) - (x - (a + c - b));
          c -= tmp;
          chmax(c, b);
          a += x - (a + c - b);
          chmin(a, x);
        }
      }
      pre = t[idx];
      if (A[idx] <= b)
        cout << a << endl;
      else if (A[idx] <= c)
        cout << a + A[idx] - b << endl;
      else
        cout << a + c - b << endl;
      ++idx;
    }
    if (i % 2 == 0) {
      if (a >= r[i] - pre)
        a -= r[i] - pre;
      else {
        b += (r[i] - pre) - a;
        chmin(b, c);
        a = 0;
      }
    } else {
      if (a + c - b + r[i] - pre <= x)
        a += r[i] - pre;
      else {
        int tmp = (r[i] - pre) - (x - (a + c - b));
        c -= tmp;
        chmax(c, b);
        a += x - (a + c - b);
        chmin(a, x);
      }
    }
    pre = r[i];
  }
  while (idx < q) {
    if (k % 2 == 0) {
      if (a >= t[idx] - pre)
        a -= t[idx] - pre;
      else {
        b += (t[idx] - pre) - a;
        chmin(b, c);
        a = 0;
      }
    } else {
      if (a + c - b + t[idx] - pre <= x)
        a += t[idx] - pre;
      else {
        int tmp = (t[idx] - pre) - (x - (a + c - b));
        c -= tmp;
        chmax(c, b);
        a += x - (a + c - b);
        chmax(a, x);
      }
    }
    if (A[idx] <= b)
      cout << a << endl;
    else if (A[idx] <= c)
      cout << a + A[idx] - b << endl;
    else
      cout << a + c - b << endl;
    ++idx;
  }
  return 0;
}
