#include <bits/stdc++.h>
using namespace std;
int k, q, p[100005];
long long first, f[100005], ans;
pair<long long, long long> c[100005], b[100005], a[100005];
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> first >> k;
  for (int i = 1; i <= k; i++) {
    cin >> f[i];
  }
  cin >> q;
  for (int i = 1; i <= q; i++) {
    cin >> c[i].second >> c[i].first;
    b[i] = {c[i].first, i};
  }
  sort(b + 1, b + q + 1);
  for (int i = 1; i <= q; i++) {
    p[b[i].second] = i;
    a[i] = c[b[i].second];
  }
  long long l = 1, r = q, t = 1, diff = 0, left = 0, right = first;
  for (int i = 1; i <= k; i++) {
    while (t <= q && a[p[t]].second <= f[i]) {
      int val;
      if (p[t] < l)
        val = left;
      else if (p[t] > r)
        val = right;
      else
        val = a[p[t]].first + diff;
      if (i % 2)
        val -= (a[p[t]].second - f[i - 1]);
      else
        val += (a[p[t]].second - f[i - 1]);
      if (val < 0) val = 0;
      if (val > first) val = first;
      cout << val << '\n';
      t++;
    }
    if (i % 2) {
      diff -= (f[i] - f[i - 1]);
      right -= (f[i] - f[i - 1]);
      left -= (f[i] - f[i - 1]);
      if (left < 0) left = 0;
      if (right < 0) right = 0;
      while (a[l].first + diff <= 0 && l < r) l++;
    } else {
      diff += (f[i] - f[i - 1]);
      right += (f[i] - f[i - 1]);
      left += (f[i] - f[i - 1]);
      if (left > first) left = first;
      if (right > first) right = first;
      while (a[r].first + diff >= first && l < r) r--;
    }
  }
  while (t <= q) {
    int val;
    if (p[t] < l)
      val = left;
    else if (p[t] > r)
      val = right;
    else
      val = a[p[t]].first + diff;
    if ((k + 1) % 2)
      val -= (a[p[t]].second - f[k]);
    else
      val += (a[p[t]].second - f[k]);
    if (val < 0) val = 0;
    if (val > first) val = first;
    cout << val << '\n';
    t++;
  }
}
