#include <bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n, m;
    long double r;
    cin >> n >> m;
    cin >> r;
    unordered_map <int, int> w;
    vector <double> ans(1e9 + 1, 0);
    for (int i = 0; i < n; i++) {
        int d, wt;
        cin >> d >> wt;
        w[d] = wt;
    }
    for (int i = 1; i < 1e9 + 1; i++) {
        ans[i] = (1 - r) * ans[i - 1] + r * w[i];
    }
    while (m--) {
        int d;
        cin >> d;
        cout << setprecision(7) << fixed << ans[d] << '\n';
    }
}
