#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e5 + 5;
const ll inf = 2e9;
ll x, k;
ll r[maxn];
int q;
ll t[maxn], a[maxn];
ll ab[maxn];
ll ans[maxn];
vector<int> ord;
ll fit(ll res) {
  if (res > x) {
    res = x;
  }
  if (res < -x) {
    res = -x;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> x >> k;
  r[0] = 0;
  for (int i = 1; i <= k; i++) {
    cin >> r[i];
  }
  r[++k] = inf;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> t[i] >> a[i];
  }
  ord.resize(q);
  iota(ord.begin(), ord.end(), 0);
  sort(ord.begin(), ord.end(), [&](int i, int j) {
    return make_pair(a[i], t[i]) < make_pair(a[j], t[j]);
  });
  auto gen = [&]() {
    for (int i = 1; i <= k; i++) {
      ll dt = r[i] - r[i - 1];
      ab[i] = fit((i % 2 == 1 ? -1 : +1) * 2ll * dt + ab[i - 1]);
    }
  };
  for (int z = 0; z < q; z++) {
    int qi = ord[z];
    ll a0 = a[qi];
    ab[0] = a0 - (x - a0);
    gen();
    ll qt = t[qi];
    int i = 0;
    while (r[i + 1] <= qt) i++;
    ll tt = qt - r[i];
    assert(tt >= 0);
    ll cur = (i % 2 == 1 ? +1 : -1) * 2ll * tt + ab[i];
    cur = fit(cur);
    assert((cur + x) % 2 == 0);
    ans[qi] = (cur + x) / 2;
  }
  for (int i = 0; i < q; i++) {
    cout << ans[i] << "\n";
  }
  return 0;
}
