#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, k;
  vector<int> r;
  r.push_back(0);
  cin >> x >> k;
  int temp;
  for (int i = 0; i < k; i++) {
    cin >> temp;
    r.push_back(temp);
  }
  int T, t, a, bulb[2], index;
  cin >> T;
  while (T--) {
    cin >> t >> a;
    bulb[0] = a, bulb[1] = x - a;
    for (index = 0; index < r.size(); index++) {
      if (r[index] >= t) break;
    }
    int i = 0;
    while (i < index - 1) {
      if (r[i + 1] - r[i] > bulb[0])
        bulb[0] = 0, bulb[1] = x;
      else
        bulb[0] -= (r[i + 1] - r[i]), bulb[1] += (r[i + 1] - r[i]);
      swap(bulb[0], bulb[1]);
      i++;
    }
    if (t - r[i] > bulb[0])
      bulb[0] = 0, bulb[1] = x;
    else
      bulb[0] -= t - r[i], bulb[1] += t - r[i];
    if (i % 2 == 0)
      cout << bulb[0] << endl;
    else
      cout << bulb[1] << endl;
  }
}
