# coding: utf-8
def II(): return int(input())
def ILI(): return list(map(int, input().split()))
 
 
def read():
    X = II()
    K = II()
    r = ILI()
    Q = II()
    queries = [ILI() for __ in range(Q)]
    return X, K, r, Q, queries
 
 
def solve(X, K, r, Q, queries):
    l_ans = []
    r.insert(0, 0)
    dif_r = [r[i + 1] - r[i] for i in range(K)]
    dif_r.append(10 ** 9)
    for query in queries:
        t, a = query
        dif_r_ind = 0
        now_state = 0
        now_time = 0
        ans = a
        while True:
            if now_time + dif_r[dif_r_ind] > t:
                if now_state == 1:
                    ans += t - now_time
                    ans = min(X, ans)
                else:
                    ans -= t - now_time
                    ans = max(0, ans)
                break
            else:
                if now_state == 1:
                    ans += dif_r[dif_r_ind]
                    ans = min(X, ans)
                else:
                    ans -= dif_r[dif_r_ind]
                    ans = max(0, ans)
                now_time += dif_r[dif_r_ind]
                now_state = (now_state + 1) % 2
                dif_r_ind += 1
                continue
        l_ans.append(ans)
    ans = "\n".join(map(str, l_ans))
    return ans
 
 
def main():
    params = read()
    print(solve(*params))
 
 
if __name__ == "__main__":
    main()