n, m = map(int, input().split())
r = float(input())

from collections import defaultdict
d=defaultdict(int)
a=[[0,0]]
res=defaultdict(int)
for i in range(n):
    aa,bb=map(int,input().split())
    d[aa]=bb
    a.append([aa,bb])
a.sort()
a.append([10**9,0])
dd=defaultdict(int)
d2=defaultdict(int)
day = list(map(int, input().split()))
for i in day:
    dd[i]=1
l=(1-r)
x=0

s=[]
last=[-1]
for i in range(n+1):
    for j in range(a[i][0],a[i+1][0]):
        x=(d[j]*r)+x*l
        d2[j]=x
        if(x==last[-1]):break
        last.append(x)
for i in day:
    if(d2[i]>0):
        print(d2[i],end=' ')
    else:
        print(0,end=' ')

