//#pragma GCC optimize("0fast")
//#pragma GCC optimize("popcnt, bm2")

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    ll n, m;
    cin >> n >> m;
    long double r;
    cin >> r;
    vector<long double> ref = vector<long double>(100001, 0);
    for (ll i = 0; i < n; ++i) {
        long long d;
        long double w;
        cin >> d >> w;
        ref[d-1] = w;
    }
    vector<long double> answers = vector<long double>(100001, 0);
    answers[0] = ref[0] * r;
    for (ll i = 1; i < 100000; ++i) {
        answers[i] = (answers[i-1]*(1 - r)) + (r * ref[i]);
    }
    for (ll i = 0; i < m; ++i) {
        ll num;
        cin >> num;
        cout << setprecision(8) << fixed;
        cout << answers[num-1] << " ";
    }

    return 0;
}
