#include <bits/stdc++.h>

using namespace std;
#define int long long

signed main(){
    int n, m;
    cin>>n>>m;
    double r;
    cin>>r;
    vector<double> v(100000, 0);
    vector< pair<int, long long> > f; 
    for(int i = 0; i < n; i++){
        int x, y;
        cin>>x>>y;
        f.push_back({x, y});
    }
    sort(f.begin(), f.end());
    int j = 0;
    for(int i = 1; i < 100000; i++){
        if(j <= f.size() and f[j].first == i){
            v[i] = v[i - 1] * (1 - r) + r * f[j].second;
            j++;
        }
        else{
            v[i] = v[i-1] * (1 - r);
        }
        string c;
        c = to_string(v[i]);
        int count = 0;
        for(int i = 2; i < 8; i++){
            if(c[i] == '9') count++;
        }
        if(count == 6) v[i] = round(v[i]);
    }
    for(int i = 0; i < m; i++){
        long long x;
        cin>>x;
        if(r == 0) cout<<0<<" ";
        else{
            string c;
            c = to_string(v[x]);
            int y = 1, count = 1;;
            while(true){
                if(c[y] == '.'){
                    count = y + 1;
                    break;
                }
                y++;
            }
            if(c[count] == '0') cout<<v[x]<<" ";
            else{
                cout<<fixed;
                cout.precision(6);
                cout<<v[x]<<" ";
            }
        }
    }
}

