#include <iostream>
#include <bits/stdc++.h>
using namespace std;



int main()
{
    long long n, m, k, a, b, x = 10000;
    double r, y;
    cin >> n >> m;
    cin >> r;
    vector<double> an(x);
    vector<long long> q(n + 1, 0);
    for (long long i = 0; i < n; ++i){
        cin >> a >> b;
        q[a] = b;
    }
    vector<long long> w1;
    vector<long long> w2;
    for (long long i = 0; i < m; ++i){
        cin >> k;
        w1.push_back(k);
        w2.push_back(k);
    }
    sort(w2.begin(), w2.end());
    y = 0;
    int y1 = 0;
    map<long long, double> m1;
    for (int i = 1; i <= w2[w2.size() - 1]; ++i){
        y = y * (1 - r) + r * q[i];
        if (i == w2[y1]){
            m1[w2[y1]] = y;
            y1++;
        }
    }
    for (int i = 0; i < m; ++i){
        cout << m1[w1[i]] << " ";
    }
    return 0;
}