#include <bits/stdc++.h>
using namespace std;
int X, K, Q;
vector<int> T, R;
struct BIT {
  vector<long long> tree, lazy;
  void init() {
    tree = vector<long long>(4 * K, 0);
    lazy = vector<long long>(4 * K, 0);
  }
  void prop(int l, int r, int n) {
    if (l != r) {
      tree[2 * n] += lazy[n];
      lazy[2 * n] += lazy[n];
      tree[2 * n + 1] += lazy[n];
      lazy[2 * n + 1] += lazy[n];
      lazy[n] = 0;
    }
  }
  void upd(int a, int b, int d, int l, int r, int n) {
    if (b < l || r < a) return;
    if (a <= l && r <= b) {
      tree[n] += d;
      lazy[n] += d;
      return;
    }
    prop(l, r, n);
    int m = (l + r) >> 1;
    upd(a, b, d, l, m, 2 * n);
    upd(a, b, d, m + 1, r, 2 * n + 1);
    tree[n] = max(tree[2 * n], tree[2 * n + 1]);
  }
  int kquer(int k, int l, int r, int n) {
    if (tree[n] <= k) return K;
    if (l == r) return l;
    prop(l, r, n);
    int m = (l + r) >> 1;
    if (tree[2 * n] > k)
      return kquer(k, l, m, 2 * n);
    else
      return kquer(k, m + 1, r, 2 * n + 1);
  }
};
BIT bit[2];
vector<pair<int, int> > dp[2];
vector<long long> psum;
vector<vector<vector<pair<int, int> > > > par;
int main() {
  scanf("%d %d", &X, &K);
  R.resize(K);
  for (int i = 0; i < K; i++) {
    scanf("%d", &R[i]);
  }
  T = R;
  for (int i = K - 1; i >= 1; i--) R[i] -= R[i - 1];
  for (int i = 0; i < 2; i++) bit[i].init();
  for (int i = 0; i < 2; i++) dp[i] = vector<pair<int, int> >(K);
  for (int i = K - 1; i >= 0; i--) {
    bit[0].upd(i, K - 1, (i % 2 ? R[i] : -R[i]), 0, K - 1, 1);
    bit[1].upd(i, K - 1, (i % 2 ? -R[i] : R[i]), 0, K - 1, 1);
    if (i % 2) {
      for (int j = 0; j < 2; j++) {
        int t = bit[0].kquer(j * X, 0, K - 1, 1);
        int d = bit[1].kquer(X - j * X, 0, K - 1, 1);
        if (t < d)
          dp[j][i] = pair<int, int>(t, 0);
        else
          dp[j][i] = pair<int, int>(d, 1);
      }
    } else {
      for (int j = 0; j < 2; j++) {
        int t = bit[1].kquer(j * X, 0, K - 1, 1);
        int d = bit[0].kquer(X - j * X, 0, K - 1, 1);
        if (t < d)
          dp[j][i] = pair<int, int>(t, 0);
        else
          dp[j][i] = pair<int, int>(d, 1);
      }
    }
  }
  psum.resize(K);
  for (int i = 0; i < K; i++) {
    psum[i] = i % 2 ? R[i] : -R[i];
    if (i) psum[i] += psum[i - 1];
  }
  par = vector<vector<vector<pair<int, int> > > >(
      20, vector<vector<pair<int, int> > >(
              2, vector<pair<int, int> >(K, pair<int, int>(-1, -1))));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < K; j++) {
      par[0][i][j] = dp[i][j];
    }
  }
  for (int i = 1; i < 20; i++) {
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < K; k++) {
        pair<int, int> t = par[i - 1][j][k];
        if (t == pair<int, int>(-1, -1)) break;
        if (t.first == K)
          par[i][j][k] = pair<int, int>(K, 0);
        else
          par[i][j][k] = par[i - 1][t.second][t.first];
      }
    }
  }
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    int t, a;
    scanf("%d %d", &t, &a);
    int q = bit[1].kquer(a, 0, K - 1, 1);
    int d = bit[0].kquer(X - a, 0, K - 1, 1);
    if (min(q, d) == K || T[min(q, d)] > t) {
      int s = 0, e = K - 1;
      int x = -1;
      while (s <= e) {
        int m = (s + e) >> 1;
        if (T[m] <= t) {
          x = m;
          s = m + 1;
        } else
          e = m - 1;
      }
      long long ans = (x == -1 ? 0 : psum[x]) + a;
      ans += (x % 2 ? -1 : 1) * (t - (x == -1 ? 0 : T[x]));
      ans = max(ans, 0LL);
      ans = min(ans, 1LL * X);
      printf("%lld\n", ans);
      continue;
    }
    pair<int, int> cur;
    if (q < d)
      cur = pair<int, int>(q, 0);
    else
      cur = pair<int, int>(d, 1);
    for (int j = 20; j--;) {
      if (par[j][cur.second][cur.first].first == -1) continue;
      if (par[j][cur.second][cur.first].first == K ||
          T[par[j][cur.second][cur.first].first] > t)
        continue;
      cur = par[j][cur.second][cur.first];
    }
    a = X * cur.second;
    int s = 0, e = K - 1;
    int x = -1;
    while (s <= e) {
      int m = (s + e) >> 1;
      if (T[m] <= t) {
        x = m;
        s = m + 1;
      } else
        e = m - 1;
    }
    long long ans = ((x == -1 ? 0 : psum[x]) - (psum[cur.first])) + a;
    ans += (x % 2 ? -1 : 1) * (t - (x == -1 ? 0 : T[x]));
    ans = max(ans, 0LL);
    ans = min(ans, 1LL * X);
    printf("%lld\n", ans);
  }
}
