import sys


stdin = sys.stdin.readlines()
n, m = map(int, stdin[0].split())
r = float(stdin[1].strip())
dw = list(map(lambda x: tuple(map(int, x.split())), stdin[2:n + 2]))
q_list = list(map(int, stdin[-1].split()))

dw.sort(key=lambda x: x[0])

max_dw = dw[-1][0]
dw_iter = iter(dw)
next_dw = next(dw_iter)
new_x = 0
for i in range(max_dw + 1):
    if i == next_dw[0]:
        new_x = (1 - r) * new_x + r * next_dw[1]
        if i != max_dw:
            next_dw = next(dw_iter)
    else:
        new_x *= (1 - r)
    
    if i in q_list:
        sys.stdout.write(str(new_x) + "\n")
        q_list.remove(i)

for q in q_list:
    sys.stdout.write(str(new_x * (1 - r)**(q-max_dw)) + "\n")
