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

production_days = {}

for i in range(n):
    day, material = map(int, input().split())
    production_days[day] = material

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

if r != 0:

    waste = 0
    for i in range(max(inspection_day) + 1):
        try:
            waste += r * production_days[i]
        except KeyError:
            pass

        if i in inspection_day:
            print(f"{waste:.7f}")
        waste *= (1 - r)
else:
    for _ in range(m):
        print(0)

