def read_data_f(filename='arc082-e.dat'):
    try:
        LOCAL_FLAG
        import codecs
        import os

        lines = []
        file_path = os.path.join(os.path.dirname(__file__), filename)
        with codecs.open(file_path, 'r', 'utf-8') as f:
            for each in f:
                lines.append(each.rstrip("\r\n"))

    except NameError:
        lines = []
        lines.append(input())
        lines.append(input())
        lines.append(input())
        lines.append(input())
        Q = int(lines[3])
        for i in range(Q):
            lines.append(input())

    return lines

def remain(X, a, t, isUp):
    if(isUp):
        return max(0, a-t)
    else:
        return min(a+t, X)


def F_Sandglass():
  
    raw_data = read_data_f('arc082-f.dat')
    X = int(raw_data[0])
    K = int(raw_data[1])
    r = list(map(int, raw_data[2].split()))
    Q = int(raw_data[3])
    a = []
    t = []
    for i in range(Q):
        tt, aa = list(map(int, raw_data[i+4].split()))
        a.append(aa)
        t.append(tt)

    # print(r)
    # print(t)
    # print(a)

    for j in range(Q):
        A = {}
        time = 0
        i = 0
        A[time] = a[j]
        start_time = 0
        start_status = True
        isUp = True

        while (i < K) and (time < t[j]):
            temp = remain(X, A[time], r[i] - time, isUp)
            time = r[i]
            A[time] = temp
            isUp = not isUp

            if(r[i] < t[j]):
                start_time = r[i]
                start_status = isUp
            i += 1

        result = remain(X, A[start_time], t[j] - start_time, start_status)
        print(result)



F_Sandglass()