#include<cstdio>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstring>
#include<map>
#include<vector>
#include<set>
#define rep(i,j,k) for(register int i = j; i <= k; i++) 
#define dow(i,j,k) for(register int i = j; i >= k; i--)
#define fi first
#define se second
//#define P pair<ull,ull>
//#define PP pair<int,pair<int,int> >
//#define mp(a,b) make_pair(a,b)
#define ll long long
#define ull unsigned long long
using namespace std;
 
inline int read() { 
	int s = 0, t = 1; char c = getchar();
	while( !isdigit(c) ) { if( c == '-' ) t = -1; c = getchar(); }
	while( isdigit(c) ) s = s * 10 + c - 48, c = getchar();
	return s * t;
}

const int N = 1e5+5;
inline void Max(ll &x,ll v) { if( v > x ) x = v; }
inline void Min(ll &x,ll v) { if( x > v ) x = v; } 
struct Tag{ 
	ll fac, add; 
	Tag(ll a=1,ll b=0) { fac = a, add = b; } 
} tag[N<<2], D;

ll X, maxl[N<<2], minl[N<<2], r[N], t[N], a[N], f[N], vs, ans; 
inline int find(ll val) { 
	int l = 1, r = vs, mid;
	while( l < r ) { 
		mid = (l + r) >> 1;
		if( f[mid] >= val ) r = mid;
		else l = mid + 1;
	} return l;
}

#define lc k<<1
#define rc k<<1|1
int ql, qr;
inline Tag operator + (const Tag&a,const Tag&b) { return Tag(a.fac*b.fac,a.add*b.fac+b.add); }
inline ll operator + (const ll&a,const Tag&b) { return a * b.fac + b.add; }
inline void Add(int k,const Tag&x) { maxl[k] = maxl[k] + x, minl[k] = minl[k] + x, tag[k] = tag[k] + x;  }
inline void down(int k) { Add(lc,tag[k]), Add(rc,tag[k]), tag[k] = Tag(); }
inline void up(int k) { maxl[k] = max(maxl[lc],maxl[rc]), minl[k] = min(minl[lc],minl[rc]); }
inline void build(int l,int r,int k) { 
	minl[k] = f[l];
	maxl[k] = f[r];
	if( l == r ) return;
	int mid = (l + r) >> 1;
	build(l,mid,lc), build(mid+1,r,rc);		
}

inline ll query(int l,int r,int k) { 
	if( l == r ) return maxl[k];
	int mid = (l + r) >> 1;
	down(k);
	if( ql <= mid ) return query(l,mid,lc);
	else return query(mid+1,r,rc);
}

inline void upd(int l,int r,int k) { 
	if( ql <= l && r <= qr ) { Add(k,D); return; }
	int mid = (l + r) >> 1;
	down(k);
	if( ql <= mid ) upd(l,mid,lc);
	if( qr > mid ) upd(mid+1,r,rc);
	up(k);
}

inline int findl(int l,int r,int k) { 
	if( minl[k] >= 0 ) return 0;
	if( l == r ) return l;
	int mid = (l + r) >> 1;
	down(k);
	if( minl[rc] < 0 ) return findl(mid+1,r,rc);
	else return findl(l,mid,lc);
}

inline int findr(int l,int r,int k) { 
	if( maxl[k] <= X ) return 0;
	if( l == r ) return l;
	int mid = (l + r) >> 1;
	down(k);
	if( maxl[lc] > X ) return findr(l,mid,lc);
	else return findr(mid+1,r,rc);
}

inline void out(int l,int r,int k) { 
	if( l == r ) return;
	int mid = (l + r) >> 1;
	down(k);
	out(l,mid,lc), out(mid+1,r,rc);
}

int main() {
	X = read();
	int K = read();
	rep(i,1,K) r[i] = read(); r[++K] = 1e9 + 1;
	int Q = read();
	rep(i,1,Q) t[i] = read(), f[i] = a[i] = read();
	sort(f+1,f+Q+1), vs = unique(f+1,f+Q+1) - f - 1;
	rep(i,1,Q) a[i] = find(a[i]);
	
	build(1,vs,1); // out(1,vs,1);
	int now = 1, d = -1;
	rep(i,1,K) { 
		while( now <= Q && t[now] <= r[i] ) { 
			ql = a[now], ans = query(1,vs,1) + d * (t[now] - r[i-1]);
			Max(ans,0), Min(ans,X);
			printf("%lld\n", ans), now++;
		}
		if( now > Q ) break;
		ql = 1, qr = vs, D = Tag(1,d*(r[i]-r[i-1])), upd(1,vs,1);
		if( d == -1 ) { 
			ql = 1, qr = findl(1,vs,1), D = Tag(0,0); if( qr ) upd(1,vs,1);
		} else { 
			ql = findr(1,vs,1), qr = vs, D = Tag(0,X); if( ql ) upd(1,vs,1);
		}
		d = -d;
	//	out(1,vs,1);
	}
	return 0; 
}

Measured memory_bytes: 16896