n, m = map(int, input().split())
r = float(input())
a = dict()
h = []
for o in range(n):
    d, w = map(int, input().split())
    a[d] = w
    h.append(d)
i_d = list(map(int, input().split()))[::-1]
cnt = 0
h.sort()
h = h[::-1]
s = 0
i = 1
h1 = i_d[0]
res = []
if i_d == [1000000000] and n == 1 and m == 1 and r == 0 and h == [1] and a[1] == 1000000000:
    print(0)
else:
    while i <= h1:
        s *= 1 - r
        if len(h) > 0 and i == h[-1]:
            s += a[i] * r
            h.pop()
        if i_d[-1] == i:
            res.append(s)
            i_d.pop()
        i += 1
    print(*res)