#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define TL ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long double
#define endl '\n'
using namespace std;
int main(){
    TL
    //freopen("handshakes.in", "r", stdin);
    //freopen("handshakes.out", "w", stdout);
    int t = 1;
    //cin>>t;
    while(t--){
        int n, m;
        ll r;
        cin >> n >> m >> r;
        map<ll, ll>us, us1;
        pair<ll, ll>a[n + 17];
        for(int i = 1; i <= n; i++)
        {
            cin >> a[i].first >> a[i].second;
            us[a[i].first] = a[i].second;
        }
        ll b[m + 1], mx = -1e18;
        for(int i = 1; i <= m; i++)
        {
            cin >> b[i];
            mx = max(mx, b[i]);
        }
        ll ans = 0;
        ll x = 1000000;
        mx = min(mx,x);
        for(int i = 1; i <= mx; i++)
        {
            if(us[i] > 0)
            {
                ans = (1 - r) * ans + r * us[i];
            }
            else ans *= (1 - r);
            us1[i] = ans;
        }
        for(int i = 1; i <= m; i++)
        {
            cout << fixed << setprecision(6) << us1[b[i]] << " ";
        }
    }
}
