#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 1LL << 30;
const ll LINF = 1LL << 62;
const double eps = 1e-9;
const ll MOD = 1000000007LL;
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
};
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
};
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  ll X, K;
  cin >> X >> K;
  vector<ll> r(K + 1), sum(K + 1);
  for (int i = 1; i <= K; i++) cin >> r[i];
  for (int i = 1; i <= K; i++) {
    if (i % 2 == 0) {
      sum[i] = sum[i - 1] + r[i] - r[i - 1];
    } else {
      sum[i] = sum[i - 1] - r[i] + r[i - 1];
    }
  }
  int a = 0;
  vector<ll> v1(K + 1), v2(K + 1);
  for (int i = 1; i <= K; i++) {
    if (i % 2) {
      v1[i] = max(0LL, v1[i - 1] - (r[i] - r[i - 1]));
    } else {
      v1[i] = min(X, v1[i - 1] + r[i] - r[i - 1]);
    }
  }
  v2[0] = X;
  for (int i = 1; i <= K; i++) {
    if (i % 2) {
      v2[i] = max(0LL, v2[i - 1] - (r[i] - r[i - 1]));
    } else {
      v2[i] = min(X, v2[i - 1] + r[i] - r[i - 1]);
    }
  }
  int q;
  cin >> q;
  vector<pair<P, int>> qs(q);
  for (int i = 0; i < q; i++) {
    cin >> qs[i].first.second >> qs[i].first.first;
    qs[i].second = i;
  }
  sort(qs.begin(), qs.end());
  int i1 = 0, i2 = 0;
  ll b1 = 1, b2 = -1, ba;
  vector<int> id1(q), id2(q);
  for (int i = 0; i < q; i++) {
    a = qs[i].first.first;
    if (i == 0) {
      ll s;
      if (a != 0) {
        s = a;
        while (i1 < K) {
          i1++;
          if (i1 % 2 == 0) {
            s += r[i1] - r[i1 - 1];
            chmin(s, X);
          } else {
            s -= r[i1] - r[i1 - 1];
            if (s <= 0) {
              b1 = s;
              break;
            }
          }
        }
      } else {
        b1 = 0;
      }
    } else {
      b1 += a - ba;
      if (b1 > 0) {
        while (i1 < K) {
          i1++;
          if (i1 % 2 == 0) {
            b1 += r[i1] - r[i1 - 1];
            chmin(b1, X);
          } else {
            b1 -= r[i1] - r[i1 - 1];
            if (b1 <= 0) {
              break;
            }
          }
        }
      }
    }
    id1[i] = i1;
    ba = a;
  }
  for (int i = q - 1; i >= 0; i--) {
    a = qs[i].first.first;
    if (i == q - 1) {
      ll s = a;
      if (a != X) {
        for (int i = 1; i <= K; i++) {
          if (i % 2 == 0) {
            s += r[i] - r[i - 1];
            if (s >= X) {
              b2 = s;
              i2 = i;
              break;
            }
          } else {
            s -= r[i] - r[i - 1];
            chmax(s, 0LL);
          }
        }
      } else {
        b2 = X;
      }
    } else {
      b2 -= ba - a;
      if (b1 < X) {
        while (i2 < K) {
          i2++;
          if (i2 % 2 == 0) {
            b2 += r[i2] - r[i2 - 1];
            if (b2 >= X) {
              break;
            }
          } else {
            b2 -= r[i2] - r[i2 - 1];
            chmax(b2, 1LL);
          }
        }
      }
    }
    id2[i] = i2;
    ba = a;
  }
  vector<ll> ans(q);
  for (int i = 0; i < q; i++) {
    a = qs[i].first.first;
    ll t = qs[i].first.second, id = qs[i].second;
    int nt = upper_bound(r.begin(), r.end(), t) - r.begin();
    --nt;
    if (id1[i] < id2[i]) {
      if (nt >= id1[i]) {
        ans[id] = v1[nt];
      } else {
        ans[id] = sum[nt] + a;
      }
    } else {
      if (nt >= id2[i]) {
        ans[id] = v2[nt];
      } else {
        ans[id] = sum[nt] + a;
      }
    }
    if (nt % 2) {
      ans[id] += t - r[nt];
    } else {
      ans[id] -= t - r[nt];
    }
    chmin(ans[id], X);
    chmax(ans[id], 0LL);
  }
  for (int i = 0; i < q; i++) {
    cout << ans[i] << endl;
  }
}
