#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

//Even if we don't end up together, just know I always wished it was you.

#define pb push_back
#define ll long long
#define  all(x) x.begin(), x.end()
#define bp __builtin_popcountll
#define sqr(x) ((llong)sqrt (x))
#define b_ctz __builtin_ctzll
#define b_clz __builtin_clzll

#define DestroyLonely ios_base::sync_with_stdio(0), cin.tie (0), cout.tie (0)

typedef long long llong;
typedef long double ldouble;
typedef unsigned long long ullong;

typedef vector <int> vi;
typedef vector <vector <llong> > matrix;

typedef pair <llong, llong> pll;
typedef pair <int, int> pii;

typedef map <int, int> mii;

typedef set <int> si;

const int mxn = 1e6 + 1;
const llong mnn = 1e3 + 1;
const llong mod = 1e9 + 7;
const int inf = 1e9;
const llong linf = 1e18;
const llong magic = 1000;
const ldouble eps = 1e-9;
const ldouble pi = 3.141592653589;
const string TIME = "25/27";

inline llong log2 (llong x) {return 64 - b_clz (x) - 1;};
inline llong __lcm (llong a, llong b) {return a / __gcd (a, b) * b;}

int n, m;
double r;
int d[mxn];
double w[mxn];
double x[mxn];
pair <int, double> v[mxn];
int main(){
    int FORNNN = -1;
    cin >> n >> m;
    cin >> r;
    for(int i = 1; i <= n; i++){
        cin >> v[i].first >> v[i].second;
        FORNNN = max(v[i].first, FORNNN);
    }
    sort(v+1, v+n+1);
    int j = 1;
    x[0] = 0;
    for(int i = 1; i <= FORNNN; i++){
        if(v[j].first == i){
            x[i] = x[i - 1] * (1 - r) + r * v[j].second;
            j++;
        }else{
            x[i] = x[i - 1] * (1 - r);
        }
    }
    int q;
    for(int i = 1; i <= m; i++){
        cin >> q;
        if(q <= FORNNN) cout << x[q] << ' ';
        else cout << x[FORNNN] * pow(r, q - FORNNN) << ' ';
    }
}
/*
3 3
0.5
2 6
3 8
4 10
1 3 5
*/