#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll rangetree[2000000][3];
void push(ll curr)
{
	if (rangetree[curr][2])
	{
		rangetree[2*curr][2] = rangetree[2*curr+1][2] = 1;
		rangetree[2*curr][1] = rangetree[2*curr+1][1] = rangetree[curr][1];
		rangetree[2*curr][0] = rangetree[2*curr+1][0] = rangetree[curr][0];
	}
	else
	{
		rangetree[2*curr][1]+=rangetree[curr][1];
		rangetree[2*curr+1][1]+=rangetree[curr][1];
		rangetree[2*curr][0]+=rangetree[curr][1];
		rangetree[2*curr+1][0]+=rangetree[curr][1];
	}
	rangetree[curr][2] = rangetree[curr][1] = 0;
}
void update(ll start, ll end, ll val, ll set, ll curr = 1, ll cstart = 0, ll cend = 200010)
{
//	prllf("%lld %lld %lld %lld\n", start, end, cstart, cend);
	if (start <= cstart && cend <= end)
	{
		if (set)
		{
			rangetree[curr][2] = true;
			rangetree[curr][1] = rangetree[curr][0] = val;
		}
		else
		{
			rangetree[curr][0]+=val;
			rangetree[curr][1]+=val;
		}
		return;
	}
	push(curr);
	ll mid = (cstart+cend)/2;
	if (end <= mid) update(start, end, val, set, 2*curr, cstart, mid);
	else if (start > mid) update(start, end, val, set, 2*curr+1, mid+1, cend);
	else
	{
		update(start, end, val, set, 2*curr, cstart, mid);
		update(start, end, val, set, 2*curr+1, mid+1, cend);
	}
	rangetree[curr][0] = max(rangetree[2*curr][0], rangetree[2*curr+1][0]);
}
ll firstgreater(ll val, ll curr = 1, ll cstart = 0, ll cend = 200010)
{
	//prllf("%lld\n", val);
	if (cstart == cend) return cstart;
	push(curr);
	ll mid = (cstart+cend)/2;
	if (rangetree[2*curr][0] >= val) return firstgreater(val, 2*curr, cstart, mid);
	else return firstgreater(val, 2*curr+1, mid+1, cend);
}
ll query(ll node, ll curr = 1, ll cstart = 0, ll cend = 200010)
{
	if (cstart == cend) return rangetree[curr][0];
	push(curr);
	ll mid = (cstart+cend)/2;
	if (node <= mid) return query(node, 2*curr, cstart, mid);
	else return query(node, 2*curr+1, mid+1, cend);
}
map<ll, ll> compress;
map<pair<ll, ll>, ll> ans;
ll k, q, flips[200010], x;
pair<ll, ll> queries[200010];
set<pair<ll, ll> > inorder;
bool status;
ll pretime;
int main()
{	
	scanf("%lld%lld", &x, &k);
	for (ll i = 0; i < k; i++) scanf("%lld", &flips[i]);
	scanf("%lld", &q);
	for (ll i = 0; i < q; i++)
	{
		scanf("%lld%lld", &queries[i].first, &queries[i].second);
		compress[queries[i].second] = 0;
		inorder.insert(make_pair(queries[i].first, queries[i].second));
	}
	ll i = 1;
	for (auto it = compress.begin(); it != compress.end(); ++it)
	{
	//	prllf("%lld\n", it->first);
		update(i, i, it->first, true);
		it->second = i++;
	}
	auto it = inorder.begin();
	for (ll i = 0; i < k; i++)
	{
		/*for (ll i = 1; i <= inorder.size(); i++)
		{
			prllf("%lld ", query(i));
		}
		prllf("\n");
		*/
		ll t = flips[i];
		while (it != inorder.end() && it->first < flips[i])
		{

			ll pos = compress.find(it->second)->second;
			ll val = query(pos);
		//	prllf("  %lld\n", val);
			if (status)
			{
				val+=it->first-pretime;
			}
			else val-=it->first-pretime;
			val = min(val, x);
			val = max(val, (ll)0);
		//	prllf("  %lld\n", val);
			ans[*it] = val;
			it++;
		}
		
		if (!status)
		{
			//prllf(" hello\n");
			ll f = firstgreater(t-pretime);
			if (f > 0) update(0, f-1, 0, 1);
	//		prllf("setting 0 - %lld to 0, %lld to 100000 are += %lld\n", f-1, f, -(t-pretime));
	//		prllf("f = %lld - %lld\n", f, t-pretime);
			if (f <= 200000) update(f, 200000, -(t-pretime), 0);


		}
		else
		{
			ll f = firstgreater(x-(t-pretime));
			if (f <= 200000) update(f, 200000, x, 1);
		//	prllf("setting 0 - %lld += %lld, %lld to 100000 = %lld\n", f-1, (t-pretime), f, x);
			if (f > 0) update(0, f-1, (t-pretime), 0);
		}
		
		status = !status;
		pretime = t;
	}
	while (it != inorder.end())
		{

			ll pos = compress.find(it->second)->second;
			ll val = query(pos);
		//	prllf("  %lld\n", val);
			if (status)
			{
				val+=it->first-pretime;
			}
			else val-=it->first-pretime;
			val = min(val, x);
			val = max(val, (ll)0);
		//	prllf("  %lld\n", val);
			ans[*it] = val;
			it++;
		}
	for (ll i = 0; i < q; i++)
	{
		printf("%lld\n", ans[queries[i]]);
	}
}






















Measured memory_bytes: 33792