def calculate_waste(n, m, r, production_data, inspection_days):
    waste = 0
    waste_on_days = []

    production_data.sort(key=lambda x: x[0])  # Sort production data by day

    for i in range(n):
        day, raw_material = production_data[i]
        waste = (1 - r) * waste + r * raw_material
        if day in inspection_days:
            waste_on_days.append(waste)

    return waste_on_days

# Read input
n, m = map(int, input().split())
r = float(input())
production_data = [list(map(int, input().split())) for _ in range(n)]
inspection_days = list(map(int, input().split()))

# Calculate waste on inspection days
result = calculate_waste(n, m, r, production_data, inspection_days)

# Print the results
for waste in result:
    print("{:.9f}".format(waste))

