#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((x)&(-(x)))
#define sqr(a) ((a)*(a))
#define clr(a) (memset((a),0,sizeof(a)))
#define ls ((x)<<1)
#define rs (((x)<<1)|1)
#define mid (((l)+(r))>>1)
#define pb push_back
#define w1 first
#define w2 second
inline void read(int &x){
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}
/******************************head*******************************/
const int maxn=100005;
int X,K,r[maxn],Q,a,b,c,d;
inline void add(int v){
	c+=v;
	if(a>X-c)a=b=X-c;
	else b=b>X-c?X-c:b;
	if(b<-c)a=b=-c;
	else a=a<-c?-c:a;
}
int main(){
	read(X);read(K);
	rep(i,1,K)read(r[i]);
	a=0;b=X;c=d=0;
	read(Q);int j=1,k=-1;
	rep(i,1,Q){
		int t,x;read(t);read(x);
		for(;j<=K&&r[j]<=t;d=r[j++],k=-k)add(k*(r[j]-d));
			add(k*(t-d));d=t;
		int res;
		if(x<a)res=a+c;else if (x<=b)res=x+c;else res=b+c;
		printf("%d\n",res);
	}
	return 0;
}
