def calculate_waste(n, m, r, days, queries):
    waste = 0.0
    result = []

    for i in range(n):
        d, w = days[i]
        waste = (1 - r) * waste + r * w

    for i in range(m):
        q = queries[i]
        waste = (1 - r) * waste
        result.append(waste)

    return result

# Чтение входных данных
n, m = map(int, input().split())
r = float(input())
days = [list(map(int, input().split())) for _ in range(n)]
queries = list(map(int, input().split()))

# Вычисление результатов
result = calculate_waste(n, m, r, days, queries)

# Вывод результатов
for value in result:
    print(value)
