#include <bits/stdc++.h>
using namespace std;
const int L = 1e5 + 1;
int X;
int K;
vector<pair<int, int> > u, d;
int r[L];
int v[L];
int main() {
  scanf("%d%d", &X, &K);
  for (int i = 1; i <= K; i++) {
    scanf("%d", r + i);
  }
  u.push_back(pair<int, int>(0, 0));
  d.push_back(pair<int, int>(0, X));
  for (int i = 1; i <= K; i++) {
    if (i % 2) {
      v[i] = v[i - 1] - r[i] + r[i - 1];
      if (v[i] < -X) {
        v[i] = -X;
      }
      if (-v[i] > u.back().second) {
        u.push_back(pair<int, int>(r[i], -v[i]));
      }
    } else {
      v[i] = v[i - 1] + r[i] - r[i - 1];
      if (v[i] > X) {
        v[i] = X;
      }
      if (X - v[i] < d.back().second) {
        d.push_back(pair<int, int>(r[i], X - v[i]));
      }
    }
  }
  int Q;
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    int t, a;
    scanf("%d%d", &t, &a);
    auto it1 = upper_bound(u.begin(), u.end(), pair<int, int>(t, 1e9 + 1));
    it1--;
    auto it2 = upper_bound(d.begin(), d.end(), pair<int, int>(t, 1e9 + 1));
    it2--;
    if (it1->first < it2->first) {
      a = max(a, it1->second);
      a = min(a, it2->second);
    } else {
      a = min(a, it2->second);
      a = max(a, it1->second);
    }
    auto p = upper_bound(r, r + K + 1, t) - r;
    p--;
    a += v[p];
    a = max(0, a);
    a = min(X, a);
    if (p % 2 == 0) {
      a -= t - r[p];
    } else {
      a += t - r[p];
    }
    a = max(0, a);
    a = min(X, a);
    printf("%d\n", a);
  }
  return 0;
}
