#include <bits/stdc++.h>
using namespace std;
void func(void);
signed signed long long main(void) {
  func();
  ;
  return 0;
}
const unsigned signed long long TYPE_A_TOP = 0;
const unsigned signed long long TYPE_A_BOTTOM = 1;
class rfunc {
 public:
  unsigned signed long long tr;
  unsigned signed long long r;
  unsigned signed long long X;
  rfunc(unsigned signed long long type, unsigned signed long long r,
        unsigned signed long long rDiff, unsigned signed long long X)
      : m_type(type), tr(r), r(rDiff), X(X){};
  unsigned signed long long CalcEndA(unsigned signed long long input_a) {
    unsigned signed long long end_a;
    if (m_type == TYPE_A_TOP) {
      if (input_a <= r) {
        end_a = 0;
      } else {
        end_a = input_a - r;
      }
    } else {
      if (input_a < (X - r)) {
        end_a = r + input_a;
      } else {
        end_a = X;
      }
    }
    return end_a;
  };

 private:
  unsigned signed long long m_type;
};
unsigned signed long long CalcLastA(vector<rfunc> &r,
                                    unsigned signed long long t,
                                    unsigned signed long long a) {
  unsigned signed long long rSize = r.size();
  unsigned signed long long i;
  for (i = 0; i < rSize; i++) {
    if (r[i].tr < t) {
    } else if (r[i].tr == t) {
      return a;
    } else {
      break;
    }
  }
  signed signed long long diff;
  if (i > 0) {
    diff = (signed signed long long)(t - r[i - 1].tr);
  } else {
    diff = (signed signed long long)t;
  }
  if (i == TYPE_A_TOP) {
    a = (unsigned signed long long)max(0, (signed signed long long)a - diff);
  } else {
    a = (unsigned signed long long)min((signed signed long long)r[i - 1].X,
                                       (signed signed long long)a + diff);
  }
  return a;
}
void func(void) {
  unsigned signed long long X;
  unsigned signed long long K;
  cin >> X;
  cin >> K;
  vector<rfunc> r;
  for (unsigned signed long long i = 0; i < K; i++) {
    unsigned signed long long tmp_r;
    cin >> tmp_r;
    unsigned signed long long type = (i % 2 == 0) ? TYPE_A_TOP : TYPE_A_BOTTOM;
    unsigned signed long long rDiff = (i == 0) ? tmp_r : tmp_r - r[i - 1].tr;
    rfunc r_(type, tmp_r, rDiff, X);
    r.push_back(r_);
  }
  unsigned signed long long Q;
  cin >> Q;
  vector<unsigned signed long long> ans(Q, 0);
  for (unsigned signed long long i = 0; i < Q; i++) {
    signed signed long long t, a;
    cin >> t >> a;
    ans[i] = CalcLastA(r, t, a);
  };
  for (unsigned signed long long i = 0; i < Q; i++) {
    cout << ans[i] << endl;
  }
  return;
}
