n, m = map(int, input().split())
r = float(input())
days = []
for _ in range(n):
    d, w = map(int, input().split())
    days.append((d, w))
days.sort()  
total_waste = 0
inspections = []
for i in range(n):
    d, w = days[i]
    total_waste = (1 - r) * total_waste + r * w
    if i + 1 == n or days[i + 1][0] != d:  
        inspections.append((d, total_waste))
inspections.sort()  
inspection_days = list(map(int, input().split()))
inspection_waste = []
for day in inspection_days:
    idx = -1
    for i in range(len(inspections)):
        if inspections[i][0] <= day:
            idx = i
    if idx != -1:
        inspection_waste.append(inspections[idx][1])
for waste in inspection_waste:
    print(format(waste, ".6f"))
