n, m = map(int, input().split())
r = float(input())
total_waste = 0
inspection_days = [0] * m

for _ in range(n):
    d, w = map(int, input().split())
    total_waste = (1 - r) * total_waste + r * w

for i in range(m):
    day = int(input())
    inspection_days[i] = total_waste
    if i > 0:
        total_waste = (1 - r) * total_waste

for waste in inspection_days:
    print(waste)
