#include <bits/stdc++.h>
using namespace std;
template <typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) {
  return N;
}
template <typename InputIt>
void PRINT_RANGE(InputIt first, InputIt last) {
  for (; first != last; ++first) cout << *first << (first == last ? "" : " ");
  cout << "\n";
}
template <typename T>
void PRINT_MATRIX(T mat, size_t nr, size_t nc) {
  for (size_t r = 0; r < nr; ++r) {
    for (size_t c = 0; c < nc; ++c) {
      cout << mat[r][c] << (c == nc - 1 ? "" : " ");
    }
    cout << "\n";
  }
}
using ll = long long;
using ull = unsigned long long;
int X;
int K;
int R[100000];
int Q;
void elapse(int& top, int& bot, int dt) {
  if (top <= dt) {
    bot += top;
    top = 0;
  } else {
    top -= dt;
    bot += dt;
  }
}
int simulate(int t, int a) {
  int n_flip = 0;
  int top = a;
  int bot = X - a;
  int t_curr = 0;
  for (int i = (0); i < (K); ++i) {
    int r = R[i];
    if (r >= t) break;
    elapse(top, bot, r - t_curr);
    swap(top, bot);
    ++n_flip;
    t_curr = r;
  }
  elapse(top, bot, t - t_curr);
  int ans = n_flip % 2 ? bot : top;
  return ans;
}
int main() {
  cin >> X;
  cin >> K;
  for (int i = (0); i < (K); ++i) {
    cin >> R[i];
  }
  cin >> Q;
  for (int _ = (0); _ < (Q); ++_) {
    int t, a;
    cin >> t >> a;
    int ans = simulate(t, a);
    cout << ans << "\n";
  }
  return 0;
}
