#include <bits/stdc++.h>
using namespace std;
int keta(int n, int k) { return (n / int(pow(10, double(k - 1)))) % 10; }
long long gcd(long long n, long long m) {
  if (n < m) {
    long long a = m;
    m = n;
    n = a;
  }
  long long r = n % m;
  while (r != 0) {
    n = m;
    m = r;
    r = n % m;
  }
  return m;
}
long long lcm(long long n, long long m) { return n * m / gcd(n, m); }
int main() {
  int x, k;
  cin >> x;
  cin >> k;
  vector<int> r;
  r.resize(k + 2);
  for (int i = 0; i < k; i++) {
    cin >> r[i + 1];
  }
  r[0] = 0;
  r[k + 1] = 1000000001;
  int q;
  cin >> q;
  vector<int> t, a;
  t.resize(q);
  a.resize(q);
  for (int i = 0; i < q; i++) {
    cin >> t[i] >> a[i];
  }
  for (int i = 0; i < q; i++) {
    int j = 0;
    int m = 0;
    int ans = a[i];
    while (r[j + 1] < t[i]) {
      if (m == 0) {
        ans = max(0, ans - r[j + 1] + r[j]);
        m = 1;
      } else {
        ans = min(x, ans + r[j + 1] - r[j]);
        m = 0;
      }
      j++;
    }
    if (m == 0) {
      ans = max(0, ans - t[i] + r[j]);
    } else {
      ans = min(x, ans + t[i] - r[j]);
    }
    cout << ans << endl;
  }
}
