#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
signed main() {
  int x, k;
  cin >> x >> k;
  vector<int> r(k);
  for (int &p : r) cin >> p;
  int q;
  cin >> q;
  vector<pair<int, int> > qu(q);
  for (pair<int, int> &p : qu) {
    int t, a;
    cin >> t >> a;
    p = pair<int, int>(t, a);
  }
  int now = 0, de = 0, fl = 1, low = 0, high = x;
  for (pair<int, int> _ : qu) {
    int t = _.first, a = _.second;
    while (now < k && r[now] <= t) {
      de += fl * (r[now] - (now > 0 ? r[now - 1] : 0));
      chmin(high, x + de);
      chmax(low, de);
      fl *= -1;
      now++;
    }
    int ans, w = -de - fl * (t - (now > 0 ? r[now - 1] : 0));
    if (a < low)
      ans = low + w;
    else if (a > high)
      ans = high + w;
    else
      ans = a + w;
    if (ans < 0) ans = 0;
    if (ans > x) ans = x;
    cout << ans << endl;
  }
}
