#include <bits/stdc++.h>
using namespace std;
long long int INF = 3e18;
double Pi = 3.1415926535897932384626;
vector<long long> G[500005];
vector<pair<long long, long long> > tree[500010];
priority_queue<long long> pql;
priority_queue<pair<long long, long long> > pqp;
priority_queue<long long, vector<long long>, greater<long long> > pqls;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    pqps;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};
char dir[] = "DRUL";
long long mod = 1000000007;
long long rui(long long abc, long long bed) {
  if (bed == 0) {
    return 1;
  } else {
    long long ced = rui(abc, bed / 2);
    ced *= ced;
    ced %= mod;
    if (bed % 2 == 1) {
      ced *= abc;
      ced %= mod;
    }
    return ced;
  }
}
long long gcd(long long number1, long long number2) {
  if (number1 > number2) {
    swap(number1, number2);
  }
  if (number1 == 0 || number1 == number2) {
    return number2;
  } else {
    return gcd(number2 % number1, number1);
  }
}
void YES(bool condition) {
  if (condition) {
    cout << "YES" << endl;
    ;
  } else {
    cout << "NO" << endl;
    ;
  }
  return;
}
void Yes(bool condition) {
  if (condition) {
    cout << "Yes" << endl;
    ;
  } else {
    cout << "No" << endl;
    ;
  }
  return;
}
long long n, m, num, sum, a, b, c, d, e, f, g, h, i, j, k, w, ok, ng, l, ans, q,
    t;
long long x[500005], y[500005], r[500005];
bool flag, dame;
int main() {
  cin >> n >> k;
  for (i = 0; i < k; i++) {
    cin >> r[i];
  }
  cin >> q;
  d = -1;
  num = 0;
  long long na = 0, nb = n, va = 0, vb = n, nt = 0;
  for (i = 0; i < q; i++) {
    cin >> t >> a;
    while (t > r[num]) {
      va += d * (r[num] - nt);
      vb += d * (r[num] - nt);
      if (va < 0) {
        na += 0 - va;
        va = 0;
      }
      if (vb > n) {
        nb -= vb - n;
        vb = n;
      }
      if (vb < 0) {
        va = vb = 0;
        na = nb = n;
      }
      if (va > n) {
        va = vb = n;
        na = nb = 0;
      }
      nt = r[num];
      d *= -1;
      num++;
    }
    va += d * (t - nt);
    vb += d * (t - nt);
    if (va < 0) {
      na += 0 - va;
      va = 0;
    }
    if (vb > n) {
      nb -= vb - n;
      vb = n;
    }
    if (vb < 0) {
      va = vb = 0;
      na = nb = n;
    }
    if (va > n) {
      va = vb = n;
      na = nb = 0;
    }
    nt = t;
    if (a <= na) {
      x[i] = va;
    } else if (a >= nb) {
      x[i] = vb;
    } else {
      x[i] = va + a - na;
    }
  }
  for (i = 0; i < q; i++) {
    cout << x[i] << endl;
    ;
  }
  return 0;
}
