#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#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;
    double r; cin >> r;
    vector <vector<int>> x(n, vector <int>(2));
    vector <int> z(m);
    for (int i = 0; i < n; i++) cin >> x[i][0] >> x[i][1];
    int max1 = 0;
    for (int i = 0; i < m; i++) {
        cin >> z[i];
        if (z[i] > max1) max1 = z[i];
    }
    sort(x.begin(), x.end());
    vector <float> tuz(max1);
    int j = 0;
    for (int i = 0; i < max1; i++) {
        if (i == 0) {
            if (j >= n) continue;
            if (i + 1 != x[j][0]) continue;
            tuz[i] = x[j][1] * r;
            j++;
            continue;
        }
        tuz[i] = tuz[i - 1] * (1 - r);
        if (j >= n) continue;
        if (i + 1 == x[j][0]) { tuz[i] += x[j][1] * r; j++; }
    }
    for (int i = 0; i < m; i++) {
        cout << fixed << setprecision(6) << tuz[z[i] - 1] << " ";
    }
}