#include <bits/stdc++.h>
using namespace std;
int x, k, q, t, a;
vector<int> r;
vector<pair<int, int> > rp;
map<pair<int, int>, int> mp;
inline void simulation() {
  int sand = a, dif = 0;
  rp.resize(k);
  for (int i = 0; i < k; ++i) {
    rp[i] = (i == 0 ? make_pair(0, r[i]) : make_pair(r[i - 1], r[i]));
    mp[rp[i]] = sand;
    dif = rp[i].second - rp[i].first;
    sand = (sand - dif) < 0 ? x : x - sand + dif;
  }
}
inline int solve() {
  int l, r, m, tt = 0, up;
  l = 0, r = k;
  if (t >= rp[k - 1].second) {
    int sand = x - ((mp[rp[k - 1]] - rp[k - 1].second + rp[k - 1].first) < 0
                        ? 0
                        : mp[rp[k - 1]] - rp[k - 1].second + rp[k - 1].first);
    up = sand - (t - rp[k - 1].second);
    up = (up < 0) ? 0 : up;
    if (k % 2 == 0)
      return up;
    else
      return x - up;
  }
  while (true) {
    m = (r + l) / 2;
    if (rp[m].first <= t and t < rp[m].second) {
      break;
    } else if (rp[m].first < t and rp[m].second <= t) {
      l = m;
    } else {
      r = m;
    }
  }
  tt = t - rp[m].first;
  up = (mp[rp[m]] - tt) < 0 ? 0 : mp[rp[m]] - tt;
  if (m % 2 == 0)
    return up;
  else
    return x - up;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> x;
  cin >> k;
  r.resize(k);
  for (int i = 0; i < k; ++i) cin >> r[i];
  cin >> q;
  for (int i = 0; i < q; ++i) {
    cin >> t >> a;
    simulation();
    cout << solve() << "\n";
  }
  return 0;
}
