#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
void read_vi(vi& vec) {
  for (auto& v : vec) cin >> v;
}
void read_vpii(vpii& vec) {
  for (auto& v : vec) cin >> v.first >> v.second;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int X, K;
  cin >> X >> K;
  vi rs(K);
  read_vi(rs);
  rs.push_back(1e9 + 1);
  int Q;
  cin >> Q;
  vpii qs(Q);
  read_vpii(qs);
  vi min_a = {0};
  vi max_a = {X};
  vi min_v = {0};
  vi max_v = {X};
  int prev_t = 0;
  for (int i = 0; i != ((int)(rs).size()); ++i) {
    int delta_t = rs[i] - prev_t;
    prev_t = rs[i];
    if (i & 1) {
      if (max_v[i] + delta_t < X) {
        max_v.push_back(max_v[i] + delta_t);
        max_a.push_back(max_a[i]);
      } else {
        max_v.push_back(X);
        max_a.push_back(max(max_a[i] - max_v[i] + delta_t - X, 0));
      }
      if (min_v[i] + delta_t < X) {
        min_v.push_back(min_v[i] + delta_t);
        min_a.push_back(min_a[i]);
      } else {
        min_v.push_back(X);
        min_a.push_back(X);
      }
    } else {
      if (min_v[i] - delta_t > 0) {
        min_v.push_back(min_v[i] - delta_t);
        min_a.push_back(min_a[i]);
      } else {
        min_v.push_back(0);
        min_a.push_back(min(min_a[i] - min_v[i] + delta_t, X));
      }
      if (max_v[i] - delta_t > 0) {
        max_v.push_back(max_v[i] - delta_t);
        max_a.push_back(max_a[i]);
      } else {
        max_v.push_back(0);
        max_a.push_back(0);
      }
    }
  }
  int idx = 0;
  int rt = 0;
  for (auto& q : qs) {
    auto t = q.first;
    auto a = q.second;
    while (rs[idx] <= t) ++idx;
    if (idx >= 1) rt = rs[idx - 1];
    int delta_t = t - rt;
    int v;
    if (a >= max_a[idx]) {
      v = max_v[idx];
    } else if (a <= min_a[idx]) {
      v = min_v[idx];
    } else {
      v = min_v[idx] + (a - min_a[idx]);
    }
    if (idx & 1) {
      v = min(v + delta_t, X);
    } else {
      v = max(v - delta_t, 0);
    }
    cout << v << '\n';
  }
  return 0;
}
