#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
const double PI = acos(-1);
int main() {
  int R;
  int x, k;
  cin >> x >> k;
  vector<int> sum, maxl, minl, r;
  for (int i = 0; i < k; i++) {
    cin >> R;
    r.emplace_back(R);
    if (i == 0) {
      sum.emplace_back(-r[i]);
      maxl.emplace_back(-r[i]);
      minl.emplace_back(-r[i]);
    } else {
      if (i % 2 == 1) {
        sum.emplace_back(sum[i - 1] + r[i]);
      } else {
        sum.emplace_back(sum[i - 1] - r[i]);
      }
      if (sum[i] > maxl[i - 1])
        maxl.emplace_back(sum[i]);
      else
        maxl.emplace_back(maxl[i - 1]);
      if (sum[i] < minl[i - 1])
        minl.emplace_back(sum[i]);
      else
        minl.emplace_back(minl[i - 1]);
    }
  }
  int q;
  cin >> q;
  int t, a;
  int ans;
  int it;
  for (int i = 0; i < q; i++) {
    cin >> t >> a;
    for (int i = 0; i < k; i++) {
      if (t < r[i]) {
        it = i - 1;
        break;
      }
      if (i == k - 1) it = i;
    }
    if (it < 0) {
      ans = a - t;
    } else {
      ans = a - sum[it];
      if (minl[it] < 0) ans -= -minl[it];
      if (maxl[it] > x) ans += maxl[it] - x;
      if (it % 2 == 0) ans -= r[it] - a;
      if (it % 2 == 1) ans += r[it] + a;
    }
    cout << ans << endl;
  }
}
