#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (const auto &it : t) {
    if (it != t.begin()) os << ",";
    os << it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (const auto &it : t) {
    if (it != t.begin()) os << ",";
    os << it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const map<S, T> &t) {
  os << "{";
  for (const auto &it : t) {
    if (it != t.begin()) os << ",";
    os << it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
int T, n, m;
long long int X;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin >> X >> n;
  vector<long long int> r(n);
  for (auto &x : r) cin >> x;
  r.push_back(1ll << 50);
  cin >> m;
  vector<pair<int, int> > q(m);
  for (auto &x : q) {
    cin >> x.first >> x.second;
  }
  int T = 0, i = 0, d = -1;
  long long int minA = 0;
  long long int maxA = X;
  long long int curMin = 0;
  for (long long int x : r) {
    while (i < q.size() && q[i].first <= x) {
      int t, a;
      tie(t, a) = q[i++];
      a = (int)min(maxA, max(minA, (long long int)a));
      long long int ans = curMin + a - minA + (t - T) * d;
      cout << min(X, max(0ll, ans)) << endl;
    }
    curMin = curMin + (x - T) * d;
    minA += max(-curMin, 0ll);
    maxA = min(maxA, X + minA - curMin);
    curMin = min(X, max(0ll, curMin));
    T = x;
    d *= -1;
  }
  return 0;
}
