#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")

#include <bits/stdc++.h>

using namespace std;

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int k,q;
	ll x;
	cin >>x >>k;
	vector<ll> r(k);
	rep(i,k) cin >>r[i];
	
	cin>>q;
	//vector<ll> t(q), a(q);
	//rep(i,q) cin >>t[i] >>a[q];
	rep(zx,q){
		ll a,t; int ct=0;
		cin >>t >>a;
		ll cr=0;
		rep(j, k){
			if( r[j] > t) break;
			if( cr <= r[j]){
				if(!(j&1) ){
					a -= r[j] - cr;
					a = min(x, max(0LL,a));
				}else{
					a += r[j] - cr;
					a = min(x, max(0LL,a));
				}
				cr=r[j];
				ct++;
			}
			//printf("%d:%d  ",cr,a);
		}
		ll tm= (ct&1)? cr-t: t-cr;
		cout << min(x, max(0LL, a - tm))<<"\n";
	}
	
	
	return 0;
}