#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main(void) {
  long long int x;
  int k;
  cin >> x >> k;
  vector<long long int> r(k + 1, 0);
  for (int i = (int)(0); i < (int)(k); i++) {
    cin >> r[i + 1];
  }
  vector<long long int> el(k + 1), em(k + 1), en(k + 1);
  vector<long long int> curdir(k + 1);
  el[0] = 0;
  em[0] = x;
  en[0] = 0;
  long long int dir = -1;
  curdir[0] = -1;
  for (int i = (int)(0); i < (int)(k); i++) {
    long long int pass = r[i + 1] - r[i];
    en[i + 1] = en[i] + dir * pass;
    el[i + 1] = max(0LL, el[i] + dir * pass);
    em[i + 1] = min(x, em[i] + dir * pass);
    dir *= -1;
    curdir[i + 1] = dir;
  }
  int q;
  cin >> q;
  for (int puella = (int)(0); puella < (int)(q); puella++) {
    long long int t, a;
    cin >> t >> a;
    int idx = upper_bound(r.begin(), r.end(), t) - r.begin() - 1;
    long long int diff = t - r[idx];
    long long int base = max(el[idx], min(em[idx], a + en[idx]));
    long long int ans = max(0LL, min(x, base + curdir[idx] * diff));
    cout << ans << endl;
  }
}
