#include <iostream>
#include <vector>
#include<string>
#include<set>
#include <stack>
#include <iomanip>
#include <cmath>
#include<map>
#include <deque>
#include <queue>
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll a, ll b) {
	while (b > 0) {
		if (a < 0) {
			a = (a % b + b) % b;
		}
		else {
			a %= b;
		}
		swap(a, b);
	}
	return 0;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    ll n, m;
    cin >> n >> m;
    if (n == m && n == 1) {
        cout << 0;
        return 0;
    }
    double r;
    cin >> r;
    vector <ll> s(1e6, 0);
    vector <pair<ll, ll>> res(1e6);
    for (ll i = 0; i < n; ++i) {
        ll d, w;
        cin >> d >> w;
        s[d - 1] = w;
    }

    for (ll i = 0; i <= 1e6; ++i) {
        res[i - 1].second = res[i].first + s[i] * r;
        res[i].first = res[i].second * (1 - r);
    }
    vector <ll> q(m);
    for (ld i = 0; i < m; ++i) {
        cin >> q[i];
        cout << ld(res[q[i] - 1].second) << " ";
    }
}
