a, b = map(int, input().split())
c = float(input())
d = {}
for i in range(a):
    e, f = map(int, input().split())
    d[e] = f
g = list(map(int, input().split()))
h = 0
i = []
for j in range(1, max(g) + 1):
    if j in d:
        f = d[j]
        h = (1 - c) * h + c * f
    else:
        h *= (1 - c)
    if j in g:
        formatted_val = round(h, 6) if h != int(h) else int(h)
        i.append(formatted_val)
print(' '.join(map(str, i)), end='')
