#include <bits/stdc++.h>
using namespace std;
long long X, K;
map<long long, array<long long, 4> > States;
vector<long long> R;
long long Q;
void simulate() {
  array<long long, 4> state = {0, 0, X, X};
  long long gravity = -1;
  long long t = 0;
  for (long long i = 0; i < R.size(); ++i) {
    long long t1 = min(t + (gravity < 0 ? state[1] : X - state[3]), R[i]);
    state[gravity < 0 ? 1 : 3] += gravity * (t1 - t);
    state[gravity < 0 ? 3 : 1] += gravity * (t1 - t);
    States[t1] = state;
    t = t1;
    long long t2 = min(t + (gravity < 0 ? state[3] : X - state[1]), R[i]);
    state[gravity < 0 ? 0 : 2] -= gravity * (t2 - t);
    state[gravity < 0 ? 3 : 1] += gravity * (t2 - t);
    States[t2] = state;
    t = t2;
    States[R[i]] = state;
    t = R[i];
    gravity *= -1;
  }
}
array<long long, 4> interpolate(long long t0, array<long long, 4> from,
                                long long t1, array<long long, 4> to,
                                long long t) {
  array<long long, 4> res;
  for (long long i : {0, 1, 2, 3})
    res[i] = from[i] + (to[i] - from[i]) / (t1 - t0) * (t - t0);
  return res;
}
int main() {
  cin >> X >> K;
  for (long long i = 0; i < K; ++i) {
    long long r;
    cin >> r;
    R.push_back(r);
  }
  R.push_back(1e9 + 1);
  simulate();
  cin >> Q;
  for (long long i = 0; i < Q; ++i) {
    long long t, a;
    cin >> t >> a;
    auto it1 = States.upper_bound(t);
    auto it0 = prev(it1);
    auto state =
        interpolate(it0->first, it0->second, it1->first, it1->second, t);
    long long x0, y0, x1, y1;
    tie(x0, y0, x1, y1) = state;
    cout << (a <= x0 ? y0 : x1 <= a ? y1 : (a - x0) + y0) << endl;
  }
  return 0;
}
