#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long INF = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void solve() {
  long long x, k;
  cin >> x >> k;
  vector<long long> r(k + 1, 0);
  for (long long i = 0; i < k; i++) {
    cin >> r[i + 1];
  }
  long long q;
  cin >> q;
  long long maa = x, mia = 0;
  long long vma = x, vmi = 0;
  long long cur = 0;
  for (long long i = 0; i < q; i++) {
    long long t, a;
    cin >> t >> a;
    while (cur + 1 < k and r[cur + 1] < t) {
      long long ti = r[cur + 1] - r[cur];
      if (cur % 2 == 0) {
        if (vma - ti >= 0) {
          vma -= ti;
        } else {
          vma = 0;
          vmi = 0;
          mia = maa;
          continue;
        }
        if (vmi - ti >= 0) {
          vmi -= ti;
        } else {
          vmi = 0;
          mia = mia + (ti - vmi);
        }
      } else {
        if (vmi + ti <= x) {
          vmi += ti;
        } else {
          vmi = x;
          vma = x;
          mia = maa;
          continue;
        }
        if (vma + ti <= x) {
          vma += ti;
        } else {
          vma = x;
          maa = maa - (vma + ti - x);
        }
      }
      ++cur;
    }
    if (a >= maa) {
      if (cur % 2 == 0) {
        cout << max((vma - (t - r[cur])), 0LL) << endl;
      } else {
        cout << min((vma + (t - r[cur])), x) << endl;
      }
    } else if (a <= mia) {
      if (cur % 2 == 0) {
        cout << max((vmi - (t - r[cur])), 0LL) << endl;
      } else {
        cout << min((vmi + (t - r[cur])), x) << endl;
      }
    } else {
      if (cur % 2 == 0) {
        cout << max((vmi + (a - mia) - (t - r[cur])), 0LL) << endl;
      } else {
        cout << min((vmi + (a - mia) + (t - r[cur])), x) << endl;
      }
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
