#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <iomanip>

using namespace std;
// #define int long long


signed main()
{
    int n, m;
    cin>>n>>m;
    double r;
    cin>>r;
    map<int, double> mapik;
    int q1;
    double q2;
    for (int i=0;i<n;i++) {
        cin>>q1>>q2;
        mapik[q1] = q2;
    }
    vector<int> v(m);
    int maxi = 0;
    for (int i=0;i<m;i++) {
        cin>>v[i];
        maxi = max(maxi, v[i]);
    }
    double x = 0;
    vector<double> ot(maxi+1);
    for (int i=1;i<=maxi;i++) {
        ot[i] = (1.0-r)*x + r*mapik[i];
        x = ot[i];
    }
    for (int el : v) {
        cout << fixed << setprecision(6) << ot[el]<<" ";
    }
}
