#include <bits/stdc++.h>
using namespace std;
using uint = unsigned;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
template <typename Ch, typename Tr, typename C>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os, const C& c) {
  os << '[';
  copy(begin(c), end(c), ostream_iterator<typename C::value_type>(os, " "));
  return os << ']';
}
void print_vars(ostream&) {}
template <typename Car, typename... Cdr>
void print_vars(ostream& os, const Car& car, const Cdr&... cdr) {
  print_vars(os << car << (sizeof...(cdr) ? "," : ""), cdr...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << '(' << p.first << ',' << p.second << ')';
}
template <int I, typename Tuple>
void print_tuple(ostream&, const Tuple&) {}
template <int I, typename Car, typename... Cdr, typename Tuple>
void print_tuple(ostream& os, const Tuple& t) {
  os << get<I>(t) << (sizeof...(Cdr) ? "," : "");
  print_tuple<I + 1, Cdr...>(os, t);
}
template <typename... Args>
ostream& operator<<(ostream& os, const tuple<Args...>& t) {
  print_tuple<0, Args...>(os << '(', t);
  return os << ')';
}
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr double EPS = 1e-9;
int x, k, q;
vi ri;
vl xi, yi, ai, bi;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  while (cin >> x) {
    cin >> k;
    ri = vi(k + 1, 0);
    xi = yi = ai = bi = vl(k + 1, 0ll);
    for (int i = int(0); i < int(k); i++) cin >> ri[i + 1];
    xi[0] = ai[0] = 0;
    yi[0] = bi[0] = x;
    for (int i = int(0); i < int(k); i++) {
      ll e = ri[i + 1] - ri[i];
      if (i & 1) {
        xi[i + 1] = min(xi[i] + e, (ll)x);
        yi[i + 1] = min(yi[i] + e, (ll)x);
        if (yi[i] + e <= x)
          bi[i + 1] = bi[i];
        else
          bi[i + 1] = max(ai[i], bi[i] - (e + yi[i] - x));
        ai[i + 1] = ai[i];
      } else {
        xi[i + 1] = max(xi[i] - e, 0ll);
        yi[i + 1] = max(yi[i] - e, 0ll);
        if (xi[i] - e >= 0)
          ai[i + 1] = ai[i];
        else
          ai[i + 1] = min(ai[i] + e - xi[i], bi[i]);
        bi[i + 1] = bi[i];
      }
    }
    cin >> q;
    ll ret;
    for (int i = int(0); i < int(q); i++) {
      ll t, a;
      cin >> t >> a;
      int ind = upper_bound(begin(ri), end(ri), t) - begin(ri) - 1;
      int e = t - ri[ind];
      if (ind & 1) {
        if (a <= ai[ind])
          ret = min(xi[ind] + e, (ll)x);
        else if (a <= bi[ind])
          ret = min(yi[i] - (bi[ind] - a) + e, (ll)x);
        else
          ret = min(yi[ind] + e, (ll)x);
      } else {
        if (a <= ai[ind])
          ret = max(xi[ind] - e, 0ll);
        else if (a <= bi[ind])
          ret = max(xi[ind] + (a - ai[ind]) - e, 0ll);
        else
          ret = max(yi[ind] - e, 0ll);
      }
      cout << ret << endl;
    }
  }
  return 0;
}
