#include <bits/stdc++.h>
using namespace std;
int main() {
  int X, K, Q;
  vector<int> ret_array;
  vector<int> q_times;
  vector<int> q_a;
  cin >> X >> K;
  for (int i = 0; i < K; i++) {
    int a;
    cin >> a;
    ret_array.push_back(a);
  }
  cin >> Q;
  for (int i = 0; i < Q; i++) {
    int t, a;
    cin >> t >> a;
    q_times.push_back(t);
    q_a.push_back(a);
  }
  for (int i = 0; i < Q; i++) {
    int a = q_a[i];
    int b = X - a;
    bool tenti = true;
    int now_time = 0;
    for (int j = 0; j < ret_array.size(); j++) {
      if (ret_array[j] > q_times[i]) break;
      int back_ret_t = (j > 0 ? ret_array[j - 1] : 0);
      now_time = ret_array[j];
      int now_diff_t = ret_array[j] - back_ret_t;
      if (tenti) {
        if (now_diff_t > a) {
          b += a;
          a = 0;
        } else {
          a -= now_diff_t;
          b += now_diff_t;
        }
        tenti = false;
      } else {
        if (now_diff_t > b) {
          a += b;
          b = 0;
        } else {
          a += now_diff_t;
          b -= now_diff_t;
        }
        tenti = true;
      }
    }
    int now_diff_t = q_times[i] - now_time;
    if (tenti) {
      if (now_diff_t > a) {
        b += a;
        a = 0;
      } else {
        a -= now_diff_t;
        b += now_diff_t;
      }
      tenti = false;
    } else {
      if (now_diff_t > b) {
        a += b;
        b = 0;
      } else {
        a += now_diff_t;
        b -= now_diff_t;
      }
      tenti = true;
    }
    cout << a << endl;
  }
  return 0;
}
