#include <bits/stdc++.h>
#define int long long
#define ff irst
#define ss second
#define pb push_back
#define mp make_pair

using namespace std;

double ans[100000];

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    double r;
    cin >> n >> m;
    cin >> r;
    vector<pair<int, int> > a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i].first >> a[i].second;
    sort(a.begin(), a.end());
    vector<int> q(m);
    for (int i = 0; i < m; ++i)
        cin >> q[i];
    sort(q.begin(), q.end());
    if (r == 0) {
        while (m--)
            cout << 0 << ' ';
        return 0;
    }
    int j = 0;
    ans[0] = r * a[0].second * (a[0].first == 1);
    if (a[0].first == 1)
        ++j;
    for (int i = 1; i <= q[m - 1]; ++i) {
        ans[i] = ans[i - 1] * (1 - r) + r * a[j].second * (a[j].first == i + 1);
        if (a[j].first == i + 1)
            ++j;
    }
    for (int i = 0; i < m; ++i)
        cout << setprecision(6) << fixed << ans[q[i] - 1] << ' ';
    return 0;
}
