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

using namespace std;

double a[300009],ans[300009];


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;
    }
    double s = 0;
    for (long long i = 1; i <= 300000; i++){
        s = s * (1-z) + a[i]*z;     
        ans[i] = s;
    }
    for (int i = 0; i < m; i++){
        cin>>x;
        if (x>=300000) cout << 0 << " "; else
        if (z==0) cout << 0 <<" "; else
        if (z==1) cout << a[x]<<" "; else
        cout<<fixed<<setprecision(6) <<ans[x]<<" ";
        }
    

}
