#include <bits/stdc++.h>
using namespace std;
class ParseError {};
struct Edge {
  int from, to, cost;
  bool operator<(Edge e) { return cost < e.cost; }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int X, K;
  cin >> X >> K;
  vector<long long> r(K), rsum(K + 1);
  rsum[0] = 0;
  for (int i = (int)(0); i < (int)(K); i++) {
    cin >> rsum[i + 1];
    r[i] = rsum[i + 1] - rsum[i];
  }
  int Q;
  cin >> Q;
  vector<int> t(Q), a(Q);
  for (int i = (int)(0); i < (int)(Q); i++) {
    cin >> t[i] >> a[i];
  }
  vector<pair<pair<long long, long long>, int>> border(K + 1);
  border[0] = make_pair(make_pair(0, 0), X);
  for (int i = (int)(1); i < (int)(K + 1); i++) {
    long long lx = border[i - 1].first.first;
    long long ly = border[i - 1].first.second;
    long long rx = border[i - 1].second;
    long long ry = border[i - 1].first.second +
                   (border[i - 1].second - border[i - 1].first.first);
    if (i % 2 == 1) {
      if (ly < r[i - 1]) {
        if (ry < r[i - 1]) {
          border[i] = make_pair(make_pair(0, 0), 0);
        } else {
          border[i] = make_pair(make_pair(lx + (r[i - 1] - ly), 0), rx);
        }
      } else {
        border[i] =
            make_pair(make_pair(lx, max<long long>(0, ly - r[i - 1])), rx);
      }
    } else {
      long long up = X - r[i - 1];
      if (ry > up) {
        if (ly > up) {
          cout << 100000000 << endl;
          border[i] = make_pair(make_pair(0, X), 0);
        } else {
          border[i] = make_pair(make_pair(lx, ly + r[i - 1]), rx - (ry - up));
        }
      } else {
        border[i] =
            make_pair(make_pair(lx, min<long long>(X, ly + r[i - 1])), rx);
      }
    }
  }
  for (int i = (int)(0); i < (int)(Q); i++) {
    int low = upper_bound(rsum.begin(), rsum.end(), t[i]) - rsum.begin() - 1;
    int diff = t[i] - rsum[low];
    long long lx = border[low].first.first;
    long long ly = border[low].first.second;
    long long rx = border[low].second;
    long long ry = border[low].first.second +
                   (border[low].second - border[low].first.first);
    long long start;
    if (a[i] < lx) {
      start = ly;
    } else if (a[i] > rx) {
      start = ry;
    } else {
      start = ly + (a[i] - lx);
    }
    if (low % 2 == 0) {
      cout << max<long long>(0, start - diff) << endl;
    } else {
      cout << min<long long>(X, start + diff) << endl;
    }
  }
  return 0;
}
