n, m = map(int, input().split())
r = float(input())
days = []
ans_days = []
min_d = -1

for i in range(n):
    d, w = map(int,input().split())
    while len(days) <= d+1:
        days.append([0, 0])
    days[d][0] = w
    if min_d == -1:
        min_d = d
    if d < min_d:
        min_d = d

ans_days = input().split()
for i in ans_days:
    while len(days) <= int(i)+1:
        if len(days) > 10**5:
            break
        days.append([0, 0])

for i in range(min_d, len(days)):
    days[i][1] = round(days[i-1][1]*(1-r)+days[i][0]*r, 6)

for i in ans_days:
    if int(i) > len(days):
        print(days[-1][1])
        continue
    print(days[int(i)][1])