#include <bits/stdc++.h>
using namespace std;
const long long LLINF = (1LL << 60);
const long long INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const long long MOD = 1000000007;
template <typename T>
class CumulativeSum {
 public:
  CumulativeSum() {}
  CumulativeSum(long long sz) : m_Data(sz, T(0)){};
  void Init(long long sz) { m_Data.assign(sz, T(0)); }
  void Add(long long k, T x) {
    assert(static_cast<long long>(m_Data.size()) >= k);
    if (static_cast<long long>(m_Data.size()) <= k) {
      m_Data.push_back(x);
    } else {
      m_Data[k] = (m_Data[k] + x);
    }
  }
  void Build() {
    for (long long i = 1; i < static_cast<long long>(m_Data.size()); i++) {
      m_Data[i] = (m_Data[i] + m_Data[i - 1]);
    }
  }
  T Query(long long k) {
    if (k < 0) {
      return T(0);
    }
    return (m_Data[min(k, static_cast<long long>(m_Data.size()) - 1)]);
  }
  T Query(long long l, long long h) {
    return (this->Query(h) - this->Query(l - 1));
  }

 private:
  vector<T> m_Data;
};
static inline long long bin_search4(const vector<long long>& v, long long lb,
                                    long long ub, long long val) {
  lb--;
  ub--;
  while (ub - lb > 1) {
    long long mid = (lb + ub) / 2;
    if (v[mid] >= val) {
      ub = mid;
    } else {
      lb = mid;
    }
  }
  if (v[ub] <= val) {
    return ub;
  }
  if (lb < 0 || v[lb] > val) {
    return -1;
  }
  return lb;
}
long long X, K, Q;
vector<long long> R, T, A;
CumulativeSum<long long> cs;
vector<long long> l_bound, u_bound;
vector<long long> l_val, u_val;
long long func(long long t, long long a) {
  long long ret;
  long long pos = bin_search4(R, 0, R.size(), t);
  ;
  if (pos == -1) {
    ret = max(0LL, a - t);
  } else {
    ;
    if (l_bound[pos] <= a && a <= u_bound[pos]) {
      ;
      ret = a + cs.Query(0, pos);
    } else if (a < l_bound[pos]) {
      ;
      ret = l_val[pos];
    } else {
      ;
      ret = u_val[pos];
    };
    if (pos % 2 == 0) {
      ret += t - R[pos];
    } else {
      ret -= t - R[pos];
    }
    ret = min(ret, X);
    ret = max(ret, 0LL);
  }
  return ret;
}
vector<long long> solve() {
  vector<long long> ret;
  cs.Init(K);
  for (long long i = 0; i < K; ++i) {
    if (i == 0) {
      cs.Add(i, -R[i]);
      continue;
    }
    if (i % 2 == 0) {
      cs.Add(i, -(R[i] - R[i - 1]));
    } else {
      cs.Add(i, R[i] - R[i - 1]);
    }
  }
  cs.Build();
  l_bound.resize(K);
  u_bound.resize(K);
  l_val.resize(K);
  u_val.resize(K);
  l_bound[0] = R[0];
  u_bound[0] = X;
  l_val[0] = 0;
  u_val[0] = X - R[0];
  for (long long i = 1; i < K; ++i) {
    long long delta = abs(cs.Query(i, i));
    ;
    if (i % 2 == 0) {
      l_bound[i] = l_bound[i - 1];
      u_bound[i] = u_bound[i - 1];
      l_val[i] = l_val[i - 1] - delta;
      if (l_val[i] < 0) {
        l_bound[i] += l_val[i];
      }
      l_val[i] = max(0LL, l_val[i]);
      u_val[i] = u_val[i - 1] - delta;
      u_val[i] = max(0LL, u_val[i]);
    } else {
      u_bound[i] = u_bound[i - 1];
      l_bound[i] = l_bound[i - 1];
      l_val[i] = l_val[i - 1] + delta;
      l_val[i] = min(X, l_val[i]);
      u_val[i] = u_val[i - 1] + delta;
      if (u_val[i] > X) {
        u_bound[i] -= (u_val[i] - X);
      }
      u_val[i] = min(X, u_val[i]);
    };
  }
  for (long long i = 0; i < Q; ++i) {
    ret.push_back(func(T[i], A[i]));
  }
  return ret;
}
signed main() {
  cin >> X >> K;
  R.resize(K);
  for (long long i = 0; i < K; ++i) {
    cin >> R[i];
  }
  cin >> Q;
  T.resize(Q);
  A.resize(Q);
  for (long long i = 0; i < Q; ++i) {
    cin >> T[i] >> A[i];
  }
  vector<long long> ans = solve();
  for (long long i = 0; i < ans.size(); ++i) {
    printf("%lld\n", ans[i]);
  }
  return 0;
}
