#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS (1e-8)
#define MOD 1000000007
#define PI 3.141592653589793
#define RMAX 4294967295
#define equals(a,b)(fabs((a)-(b))<EPS)

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef complex<double> comp;
typedef vector<complex<double>> vcomp;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef string::const_iterator State;
class ParseError {};
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int X, K;
	cin >> X >> K;
	vll r(K), rsum(K + 1);
	rsum[0] = 0;
	rep(i, K) {
		cin >> rsum[i + 1];
		r[i] = rsum[i + 1] - rsum[i];
	}

	int Q;
	cin >> Q;
	vi t(Q), a(Q);
	rep(i, Q) {
		cin >> t[i] >> a[i];
	}
	vector<pair<P, int>> border(K + 1);
	border[0] = mp(mp(0, 0), X);

	repl(i, 1, K + 1) {
		ll lx = border[i - 1].first.first;
		ll ly = border[i - 1].first.second;
		ll rx = border[i - 1].second;
		ll ry = border[i - 1].first.second + (border[i - 1].second - border[i - 1].first.first);

		if (i % 2 == 1) {
			if (ly < r[i - 1]) {
				if (ry < r[i - 1]) {
					border[i] = mp(mp(0, 0), 0);
				}
				else {
					border[i] = mp(mp(lx + (r[i - 1] - ly), 0), rx);
				}
			}
			else {
				border[i] = mp(mp(lx, max<ll>(0, ly - r[i - 1])), rx);
			}
		}
		else {
			ll up = X - r[i - 1];
			if (ry > up) {
				if (ly > up) {
					border[i] = mp(mp(0, X), 0);
				}
				else {
					border[i] = mp(mp(lx, ly + r[i - 1]), rx - (ry - up));
				}
			}
			else {
				border[i] = mp(mp(lx, min<ll>(X, ly + r[i - 1])), rx);
			}
		}
	}
	rep(i, Q) {
		int low = upper_bound(all(rsum), t[i]) - rsum.begin() - 1;
		int diff = t[i] - rsum[low];

		ll lx = border[low].first.first;
		ll ly = border[low].first.second;
		ll rx = border[low].second;
		ll ry = border[low].first.second + (border[low].second - border[low].first.first);

		ll start;
		if (a[i] < lx) {
			start = ly;
		}
		else if (a[i] > rx) {
			start = ry;
		}
		else {
			start = ly + (a[i] - lx);
		}

		if (low % 2 == 0) {
			cout << max<ll>(0, start - diff) << endl;
		}
		else {
			cout << min<ll>(X, start + diff) << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 5888