#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  int k;
  cin >> x >> k;
  long long int r[100001], ra[100001];
  r[0] = 0;
  ra[0] = 0;
  for (int i = 1; i <= k; i++) {
    cin >> r[i];
    if (i % 2)
      ra[i] = ra[i - 1] + r[i] - r[i - 1];
    else
      ra[i] = ra[i - 1] - r[i] + r[i - 1];
  }
  int q;
  cin >> q;
  long long int a[100000], ans[100000];
  pair<long long int, long long int> ti[100000];
  for (int i = 0; i < q; i++) {
    long long int t;
    cin >> t >> a[i];
    ti[i] = pair<long long int, long long int>(t, i);
  }
  sort(ti, ti + q);
  long long int x1 = 0, x2 = x;
  int j = 0;
  for (int i = 0; i <= k; i++) {
    while (j < q && (i == k || ti[j].first < r[i + 1])) {
      int i1 = ti[j].second;
      long long int t1 = ti[j].first - r[i];
      if (x1 > a[i1]) {
        if (i % 2)
          ans[i1] = min(x, x1 - ra[i] + t1);
        else
          ans[i1] = max(0ll, x1 - ra[i] - t1);
      } else if (x2 < a[i1]) {
        if (i % 2)
          ans[i1] = min(x, x2 - ra[i] + t1);
        else
          ans[i1] = max(0ll, x2 - ra[i] - t1);
      } else {
        if (i % 2)
          ans[i1] = min(x, a[i1] - ra[i] + t1);
        else
          ans[i1] = max(0ll, a[i1] - ra[i] - t1);
      }
      j++;
    }
    if (i == k) break;
    if (i % 2) {
      if (x + ra[i + 1] < x2) x2 = x + ra[i + 1];
    } else {
      if (ra[i + 1] > x1) x1 = ra[i + 1];
    }
  }
  for (int i = 0; i < q; i++) cout << ans[i] << endl;
  return 0;
}
