#include <bits/stdc++.h>
#define ent '\n'
#define f first
#define s second
 
using namespace std;
typedef long long ll;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
 
const int maxn = 1e7 + 100;
const int mod = 1e9 + 7;
 
int n, m;
double r;
double a[maxn];
int q[maxn];
double ans[maxn];
 
double binpow(double a , int b){
	if(b == 0){
		return 1 ;
	}
	if(b % 2){
		return binpow(a , b - 1) * a ;
	}
	double x = binpow(a , b / 2);
	return x * x ;
}
 
void solve(){
    cin >> n >> m >> r;
    for(int i = 1;i <= n;i++){
        int pos;
        cin >> pos;
        cin >> a[pos];
    }
    double x = 0;
    for(int i = 1;i < maxn;i++){
        x = x + a[i] * r;
        ans[i] = x;
        x = x * (1.0 - r);
    }
    for(int i = 1;i <= m;i++){
        cin >> q[i];
    }
    for(int i = 1;i <= m;i++){
        cout << fixed << setprecision(6);
        if(q[i] >= maxn){
            cout << binpow((1 - r) , q[i] - (n + m)) * ans[maxn - 1] << " ";
            continue;
        }
        cout << ans[q[i]] << " ";
    }
}
 
int main(){ 
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int i = 1;i <= T;i++){
        solve();
    }
}
