#include <bits/stdc++.h>
using namespace std;
long long da[340];
long long db[340];
long long d[340][340];
int main() {
  long long X;
  cin >> X;
  long long K;
  cin >> K;
  vector<long long> vk;
  vk.push_back(0);
  for (long long i = (0); i < (K); ++i) {
    long long a;
    cin >> a;
    vk.push_back(a);
  }
  for (long long i = (0); i < (115600 - K); ++i) {
    vk.push_back(1000000001 + i);
  }
  long long q;
  cin >> q;
  vector<pair<long long, long long> > vq;
  for (long long i = (0); i < (q); ++i) {
    long long a, b;
    cin >> a >> b;
    vq.push_back(make_pair(a, b));
  }
  for (long long i = (0); i < (340); ++i) {
    long long a = 0;
    long long b = X;
    for (long long k = 340 - 1LL; k >= (0); --k) {
      long long d = vk[i * 340 + k] - vk[i * 340 + k - 1];
      if (k % 2 == 1) {
        a = min(X, a + d);
        b = max(0LL, b - d);
      } else {
        a = max(0LL, a - d);
        b = min(X, b + d);
      }
    }
    da[i] = a;
    db[i] = b;
  }
  for (long long i = (0); i < (vq.size()); ++i) {
    long long a = vq[i].first;
    long long t = vq[i].second;
    long long c = 0;
    for (long long j = (1); j < (340); ++j) {
      if (t < vk[j * 340]) break;
      c++;
    }
    long long a1 = a;
    long long b1 = X - a;
    for (long long j = (0); j < (c); ++j) {
      if (da[j] < a1) {
        a1 = a1 - da[j];
        b1 = X - a1;
      } else {
        a1 = 0;
        b1 = X - a1;
      }
      long long d = vk[340 * (j + 1)] - vk[340 * (j + 1) - 1];
      a1 = min(X, a1 + d);
      b1 = max(0LL, b1 - d);
    }
    long long index = 0;
    for (long long j = (1); j < (340); ++j) {
      if (t < vk[c * 340 + j]) break;
      index++;
      long long d = vk[c * 340 + j] - vk[c * 340 + j - 1];
      if (j % 2 == 1) {
        a1 = min(X, a1 + d);
        b1 = max(0LL, b1 - d);
      } else {
        a1 = max(0LL, a1 - d);
        b1 = min(X, b1 + d);
      }
    }
    long long t1 = t - vk[c * 340 + index];
    if (index % 2 == 1) {
      a1 = min(X, a1 + t1);
      b1 = max(0LL, b1 - t1);
      cout << a1 << endl;
    } else {
      a1 = max(0LL, a1 - t1);
      b1 = min(X, b1 + t1);
      cout << b1 << endl;
    }
  }
  return 0;
}
