#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <iomanip>

#define ll long long
#define ld long double 

using namespace std;

int main() {
    int n, m; cin >> n >> m;
    ld r; cin >> r;
    map <int, int> d;
    for (int i = 0; i < n; ++i) {
        int k; cin >> k;
        cin >> d[k];
    }
    vector <ld> tuz(1e9, 0);
    tuz[0] = r * d[1];
    for (int i = 1; i < 1e9; ++i) {
        tuz[i] = tuz[i - 1] * (1 - r);
        tuz[i] += d[i + 1] * r;
    }
    for (int i = 0; i < m; ++i) {
        int c; cin >> c;
        cout << fixed << setprecision(6) << tuz[c - 1] << " ";
    }
}