#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  long long int k;
  cin >> k;
  vector<long long int> r(k);
  for (long long int i = 0; i < (k); i++) cin >> r[i];
  long long int q;
  cin >> q;
  vector<long long int> v;
  for (long long int i = 0; i < (k); i++) {
    if (i == 0)
      v.push_back(-r[0]);
    else if (i % 2 == 0)
      v.push_back(-(r[i] - r[i - 1]));
    else
      v.push_back(r[i] - r[i - 1]);
  }
  if (k % 2 == 0)
    v.push_back(-(1e9 - r[k]));
  else
    v.push_back(1e9 - r[k]);
  for (long long int times = 0; times < (q); times++) {
    long long int t, a;
    cin >> t >> a;
    long long int sumtime = 0;
    for (long long int i = 0; i < (k + 1); i++) {
      if (t < sumtime + abs(v[i])) {
        long long int d = ((0 < v[i]) ? 1 : -1) * (t - sumtime);
        a = max(min(a + d, x), 0ll);
        sumtime += abs(v[i]);
        break;
      } else {
        a = max(min(a + v[i], x), 0ll);
        sumtime += abs(v[i]);
      }
    }
    cout << a << endl;
  }
  return 0;
}
