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

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

diws.sort(key=lambda x: x[0])

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

"""
for d,w in diws:
    if d == 1:
        waste = w * r
        break
"""

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


print([diws[0] for _ in diws])
if 1 not in [diws[0][0] for _ in diws]:
    dic[1] = 0


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:
    try:
        print(dic[i])
    except KeyError:
        waste = dic[i-1] * (1 - r)
        print(waste)