#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#include <iomanip>

using namespace std;

double a[100009],ans[1000000];
void find (long long h, double j) {
	double s = 0;
    for (long long i = 1; i <= h; i++){
        s = s * (1-j) + a[i]*j;     
        ans[i] = s;
    }
}

int main() {
    long long n,m,x;
    double z,y;
    cin>>n>>m;
    cin>>z;
    for (int i = 0; i < n; i++){
        cin>>x>>y;
        a[x] = y;
    }
    for (int i = 0; i < m; i++){
        cin>>x;
        if (z==0) cout << 0 <<" ";
        else if (z==1) cout << a[x]<<" ";
        else if (x>=1000000) cout << 0 << " ";
        else {find (x, z);
        	cout<<fixed<<setprecision(6) <<ans[x]<<" ";
        }
    }

}
