#include <bits/stdc++.h>
#define CODE_HERE ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
int main()
{
    CODE_HERE;
    int n, m;
    cin >> n >> m;
    double r, otx = 0;
    cin >> r;
    map <long long, long double> ans;
    map <long long, long long> mp;
    for(long long i = 0; i < n; i++) {
        long long a, b;
        cin >> a >> b;
        mp[a] = b;
    }
    for(long long i = 1; i <= 10000000; i++) {
        ans[i] = mp[i] * r + otx * (1 - r);
        otx = ans[i];
    }
    while(m--) {
        long long v;
        cin >> v;
        cout << fixed << setprecision(6);
        cout << ans[v] << endl;
    }
}