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

diws = []
for _ in range(n):
    d, w = map(int, input().split())
    diws.append([d,w])

qis = list(map(int, input().split()))
waste = 0

dic = {}

for i in range(len(diws)):
    d, w = diws[i][0], diws[i][1]
    waste = (1 - r) * waste + r * w
    dic[d] = waste


def find_closest_right_key(dictionary, key):
    keys = list(dictionary.keys())
    keys.sort()

    closest_right_key = None

    for k in keys:
        if k >= key:
            closest_right_key = k
            break

    if closest_right_key is not None:
        return dictionary[closest_right_key]
    else:
        return dictionary[max(keys)]


for i in qis:
    if i == 1:
        print(0)
    else:
        try:
            print(dic[i])
        except KeyError:
            print(find_closest_right_key(dic, i) * r)
