#include <bits/stdc++.h>
using namespace std;

int main(){
	int x, k, q;
	// cin >> x >> k;
	scanf("%d\n%d", &x, &k);
	int r[k+1] = {0}, xv[k+1], zv[k+1], cr[k+1], minax[k+1], c = 0, sgn = -1;
	for(int i = 1; i <= k; i++){
		scanf("%d", &r[i]);
		c += sgn*(r[i]-r[i-1]);
		// c = min(x, c);
		// c = max(c, 0);
		cr[i] = c;
		sgn *= -1;
	}
	minax[0] = 0;
	minax[1] = cr[1];
	if(k > 1)
		minax[2] = cr[2];
	for(int i = 3; i <=k ; i+=2){
		minax[i] = min(minax[i-2], cr[i]);
	}
	for(int i = 4; i <=k ; i+=2){
		minax[i] = max(minax[i-2], cr[i]);
	}
	int az = 0, ax = x;
	sgn = -1;
	zv[0] = 0;
	xv[0] = x;
	for(int i = 1; i <= k; i++){
		zv[i] = zv[i-1] + sgn*(r[i]-r[i-1]);
		zv[i] = min(max(zv[i], 0), x);
		xv[i] = xv[i-1] + sgn*(r[i]-r[i-1]);
		xv[i] = max(min(xv[i], x), 0);
		sgn *= -1;
	}
	// int q;
	scanf("%d", &q);
	while(q--){
		int t, a;
		scanf("%d %d", &t, &a);
		int d = 0, u = k;
		while(d < u-1){
			int mid = (d+u)/2;
			if(r[mid] < t){
				d = mid;
			}else{
				u = mid;
			}
		}
		if(r[u] <= t)
			d = u;
		// printf("dd %d\n", d);
		if(d%2){
			if(a <= -minax[d]){
				printf("%d\n", min(x, zv[d] + t-r[d]));
			}else if(a >= x-minax[d-1]){
				printf("%d\n", min(x, xv[d]+t-r[d]));
			}else printf("%d\n", min(a+cr[d]+ t-r[d], x));
		}else{
			if(a >= x-minax[d]){
				printf("%d\n", max(0, xv[d]-t+r[d]));
			}else if(a <= -minax[d-1]){
				printf("%d\n", max(0, zv[d]-t+r[d]));
			}else{
				printf("%d\n", max(0, a + cr[d] -t +r[d]));
			}
		}
	}
	return 0;
}