n, m = map(int, input().split())
r = float(input())
waste_at_day = [0.0] * (n + 1)

for i in range(n):
    d, w = map(int, input().split())
    waste_at_day[d] = (1 - r) * waste_at_day[d - 1] + r * w

inspection_days = list(map(int, input().split()))
for day in inspection_days:
    print(waste_at_day[day])
