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

current_waste = 0

for _ in range(n):
    di, wi = map(int, input().split())
    current_waste = (1 - r) * current_waste + r * wi

inspection_days = list(map(int, input().split()))

for day in inspection_days:
    print("{:.10f}".format(current_waste))
