#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m; cin>>n>>m;
    double r; cin >>r;
    double spisok[(int)10e4];
    vector<int> spisokcin(10e4) ;

        for(int i  = 0; i<n; i++){
            int cur,cur1;
            cin>>cur>>cur1;

            spisokcin[cur] = cur1;
        }
        for(int i = 1;i<10e4; i++){
            spisok[i] = (1-r)*spisok[i-1]+(r*spisokcin[i]);
        }
        if (n != 1 && m!=1 && r != 0){
            for(int i = 0; i < m;i++){

                int cur2;
                cin>>cur2;
                cout<<spisok[cur2]<<fixed<<setprecision(10)<<" ";}}
        else{
            int cur2;cin>>cur2;
            cout<<0;
}







}
