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


vector<double> an(10000, 0);
int main()
{
    long long n, m, k, a, b, x = 10000;
    double r;
    cin >> n >> m;
    cin >> r;
    vector<double> q(n + 1, 0);
    for (int i = 0; i < n; ++i){
        cin >> a >> b;
        q[a] = b;
    }

    
    an[0] = 0;
    for (int i = 1; i <= x; ++i){
        an[i] = an[i - 1] * (1 - r) + r * q[i];
    }
    for (int i = 0; i < m; ++i){
        cin >> k;
        if (k >= 10000){
            cout << 0 << " ";
        }else{
           cout << an[k] << " "; 
        }
        
    }
    return 0;
}