#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
template <class T>
bool set_min(T &a, const T &b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool set_max(T &a, const T &b) {
  return a < b ? a = b, true : false;
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &a : v) is >> a;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) os << "\t" << t;
  return os << endl;
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &v) {
  return os << "<" << v.first << ", " << v.second << ">";
}
const int INF = 1 << 30;
const ll INFL = 1LL << 60;
void solve() {
  ll X, K;
  cin >> X >> K;
  vector<ll> R(K + 1);
  R[0] = 0;
  for (int i = 0; i < (int)(K); i++) cin >> R[i + 1];
  auto clip = [&](ll &a) {
    set_min(a, X);
    set_max(a, 0LL);
  };
  vector<ll> sum(K + 1);
  for (int k = 0; k < (int)(K); k++)
    sum[k + 1] = sum[k] + (k % 2 == 0 ? -1 : 1) * (R[k + 1] - R[k]);
  vector<ll> h(K + 1), l(K + 1);
  vector<ll> ub(K + 1), lb(K + 1);
  h[0] = X;
  l[0] = 0;
  ub[0] = X;
  lb[0] = 0;
  for (int k = 0; k < (int)(K); k++) {
    ll dir = k % 2 == 0 ? -1 : 1;
    ll d = (R[k + 1] - R[k]) * dir;
    h[k + 1] = h[k] + d;
    l[k + 1] = l[k] + d;
    if (dir > 0) {
      ub[k + 1] = min(ub[k], ub[k] - (X - (h[k] + d)));
      lb[k + 1] = lb[k];
    } else {
      lb[k + 1] = max(lb[k], lb[k] + -(l[k] + d));
      ub[k + 1] = ub[k];
    }
    clip(h[k + 1]);
    clip(l[k + 1]);
    clip(ub[k + 1]);
    clip(lb[k + 1]);
  }
  ll Q;
  cin >> Q;
  for (int q = 0; q < (int)(Q); q++) {
    ll t, a;
    cin >> t >> a;
    int i = upper_bound(R.begin(), R.end(), t) - begin(R) - 1;
    assert(i >= 0);
    ll ans = 0;
    if (a > ub[i])
      ans = h[i];
    else if (a < lb[i])
      ans = l[i];
    else
      ans = a + sum[i];
    ll dir = i % 2 == 0 ? -1 : 1;
    ans += (t - R[i]) * dir;
    clip(ans);
    cout << ans << endl;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
