n, m = map(int, input().split())
r = float(input())
info = [list(map(int, input().split())) for _ in range(n)]
q = list(map(int, input().split()))
if r == 0:
    print(0)
else:
    days = max(q)
    ans = [[0, 0] for _ in range(days)]
    current = 0
    for i, x in info:
        ans[i - 1][0] = x
    for i in range(days):
        current = current * (1 - r) + ans[i][0] * r
        ans[i][1] = current
    for i in q:
        print(ans[i - 1][1], end=' ')
