#include <bits/stdc++.h>
using namespace std;
long long value_bottom[200000] = {};
long long value_top[200000] = {};
int value_normal[200000] = {};
long long border_bottom[200000] = {};
long long border_top[200000] = {};
vector<long long> vertex;
int main() {
  long long x, k;
  cin >> x >> k;
  vertex.push_back(0);
  for (long long i = 0; i < k; ++i) {
    long long r;
    cin >> r;
    vertex.push_back(r);
  }
  k++;
  value_top[0] = x;
  for (int i = 1; i < k; ++i) {
    if (i % 2 == 1) {
      value_top[i] = value_top[i - 1] - (vertex[i] - vertex[i - 1]);
      value_top[i] = max(value_top[i], (long long)0);
      value_bottom[i] = value_bottom[i - 1] - (vertex[i] - vertex[i - 1]);
      value_bottom[i] = max(value_bottom[i], (long long)0);
    } else {
      value_bottom[i] = value_bottom[i - 1] + (vertex[i] - vertex[i - 1]);
      value_bottom[i] = min(value_bottom[i], x);
      value_top[i] = value_top[i - 1] + (vertex[i] - vertex[i - 1]);
      value_top[i] = min(value_top[i], x);
    }
  }
  long long now = 0;
  border_top[0] = x;
  for (int i = 1; i < k; ++i) {
    if (i % 2 == 1) {
      now += vertex[i] - vertex[i - 1];
      value_normal[i] = now;
      border_bottom[i] = max(border_bottom[i - 1], now);
      border_top[i] = min(border_top[i - 1], x + now);
    } else {
      now -= vertex[i] - vertex[i - 1];
      border_top[i] = min(border_top[i - 1], x + now);
      border_bottom[i] = max(border_bottom[i - 1], now);
    }
  }
  int query;
  cin >> query;
  for (int i = 0; i < query; ++i) {
    long long a, b;
    cin >> a >> b;
    int point = lower_bound(vertex.begin(), vertex.end(), a) - vertex.begin();
    if (point == vertex.size() || vertex[point] != a) point--;
    if (point % 2 == 0) {
      if (border_top[point] <= b) {
        cout << max(value_top[point] - (a - vertex[point]), (long long)0)
             << endl;
      } else if (border_bottom[point] >= b) {
        cout << max(value_bottom[point] - (a - vertex[point]), (long long)0)
             << endl;
      } else {
        cout << max(b - value_normal[point] - (a - vertex[point]), (long long)0)
             << endl;
      }
    } else {
      if (border_top[point] <= b) {
        cout << min(value_top[point] + (a - vertex[point]), (long long)x)
             << endl;
      } else if (border_bottom[point] >= b) {
        cout << min(value_bottom[point] + (a - vertex[point]), (long long)x)
             << endl;
      } else {
        cout << min(b - value_normal[point] + (a - vertex[point]), (long long)x)
             << endl;
      }
    }
  }
  return 0;
}
