#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e8;
const long long mod = (long long)1e9 + 7;
const long double eps = 1e-9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
int main() {
  int x, k;
  cin >> x >> k;
  vector<int> r(k);
  for (int i = 0; i < k; i++) cin >> r[i];
  int q;
  cin >> q;
  vector<pair<int, int> > query(q);
  for (int i = 0; i < q; i++) cin >> query[i].first >> query[i].second;
  int left = 0, right = x;
  int val = 0, val2 = x;
  r.insert(r.begin(), 0);
  r.push_back(2e9);
  k += 2;
  int s = 0;
  for (int i = 1; i < k; i++) {
    while (s < q && query[s].first < r[i]) {
      int amount =
          (left >= query[s].second
               ? val
               : (right <= query[s].second ? val2
                                           : val + (query[s].second - left)));
      if (i & 1) {
        cout << max(0, amount - (query[s].first - r[i - 1])) << endl;
      } else {
        cout << min(x, amount + (query[s].first - r[i - 1])) << endl;
      }
      s++;
    }
    if (i & 1) {
      val -= r[i] - r[i - 1];
      if (val < 0) {
        left -= val;
        val = 0;
      }
      val2 -= r[i] - r[i - 1];
      if (val2 < 0) {
        right = x;
        val2 = 0;
      }
    } else {
      val2 += r[i] - r[i - 1];
      if (val2 > x) {
        right -= val2 - x;
        val2 = x;
      }
      val += r[i] - r[i - 1];
      if (val > x) {
        left = 0, val = x;
      }
    }
  }
  return 0;
}
