#include<iostream>
#include<cstdio>
using namespace std;
inline read()
{
    int x=0,f=1;char c;
    c=getchar();
    while(c>'9'||c<'0'){c=getchar();if(c=='-')f=-1;}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
int r[100005];
int main()
{
    int x,n;
    x=read(),n=read();
    for(int i=1;i<=n;i++)
    {
        r[i]=read();
        cout<<r[i]<<endl;
    }
    //r[0]=0;
    int L=0;
    int R=x;
    int tmp=0;
    int q;q=read();
    int now=1;
    while(q--)
    {
        int t,a;
        t=read(),a=read();
        while(now<=n&&t>=r[now])
        {
            L+=(r[now]-r[now-1])*(now&1==1?-1:1);
            R+=(r[now]-r[now-1])*(now&1==1?-1:1);
            tmp+=(r[now]-r[now-1])*(now&1==1?-1:1);
            if(L<0)L=0;
            if(L>x)L=x;
            if(R<0)R=0;
            if(R>x)R=x;
            now++;
        }
       // printf("%d %d %d\n",now,L,R);
        int ans=a+tmp;
        if(ans<L)ans=L;
        if(ans>R)ans=R;
        ans+=(t-r[now-1])*(now&1==1?-1:1);
        if(ans<0)ans=0;
        if(ans>x)ans=x;
        printf("%d\n",ans);
    }
}
