#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;
long long int N, M, K, L, R, H, W;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  cin >> M;
  long long int ti[100002] = {};
  for (int i = 1; i <= M; i++) {
    cin >> ti[i];
  }
  ti[M + 1] = INT_MAX;
  pair<long long int, long long int> l[200000] = {};
  pair<long long int, long long int> r[200000] = {};
  l[0] = {0, 0};
  r[0] = {N, N};
  for (int i = 1; i <= M; i++) {
    if (i % 2) {
      l[i].first = max((long long int)0, l[i - 1].first - (ti[i] - ti[i - 1]));
      l[i].second = max((long long int)0, ti[i] - ti[i - 1] - l[i - 1].first +
                                              l[i - 1].second + l[i].first);
      r[i].first = max((long long int)0, r[i - 1].first - (ti[i] - ti[i - 1]));
      r[i].second = r[i - 1].second;
      if (l[i].first == r[i].first) {
        l[i].second = N;
        r[i].second = 0;
      }
    } else {
      l[i].first = min(N, l[i - 1].first + (ti[i] - ti[i - 1]));
      l[i].second = l[i - 1].second;
      r[i].first = min(N, r[i - 1].first + (ti[i] - ti[i - 1]));
      r[i].second = min(N, r[i - 1].second - (ti[i] - ti[i - 1]) -
                               r[i - 1].first + l[i].first);
      if (l[i].first == r[i].first) {
        l[i].second = N;
        r[i].second = 0;
      }
    }
  }
  cin >> K;
  for (int i = 0; i < K; i++) {
    long long int t, a;
    cin >> t >> a;
    L = 0;
    R = M + 2;
    while (R - L > 1) {
      int mid = (L + R + 1) / 2;
      if (ti[mid] > t) {
        R = mid;
      } else {
        L = mid;
      }
    }
    if (l[L].second >= a) {
      a = l[L].first;
    } else if (r[L].second <= a) {
      a = r[L].first;
    } else {
      a = l[L].first + a - l[L].second;
    }
    if (L % 2) {
      a += t - ti[L];
    } else {
      a -= t - ti[L];
    }
    a = max((long long int)0, min(N, a));
    cout << a << endl;
  }
  return 0;
}
