ri = lambda: map(int, raw_input().split())

x = input()
k, r = input(), ri()

j, v, lb, rb, pt = 0, 0, 0, x, 0
L, R = 0, x
for i in xrange(input()):
    t, a = ri()
    while j < k and r[j] <= t:
        d = r[j] - pt
        pt = r[j]
        if j % 2 == 0:
            v -= d
            lb = max(lb - d, 0)
            rb = max(rb - d, 0)
        else:
            v += d
            lb = min(lb + d, x)
            rb = min(rb + d, x)
        L = max(L, -v)
        R = min(R, x - v)
        j += 1
    ans = 0
    if L <= a <= R:
        ans = a + v
    else:
        ans = lb if a < L else rb
    if j % 2 == 0:
        ans = max(ans - (t - pt), 0)
    else:
        ans = min(ans + (t - pt), x)
    print ans