#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;
	double r;
	cin >> r;
	vector <ll> s(1e8, 0);
	vector <pair<ll, ll>> res(1e8);
	for (ll i = 0; i < n; ++i) {
		ll d, w;
		cin >> d >> w;
		s[d - 1] = w;
	}
	for (ll i = 0; i <= 1e8; ++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) << " ";
	}
	/*ll n;
	cin >> n;
	vector<ll>s(n);
	vector<ll>d(n);
	for (ll i = 0; i < n; ++i)
		cin >> s[i];
	for (ll i = 0; i < n; ++i)
		cin >> d[i];
	if (n == 1) {
		cout << d[0];
		return 0;
	}
	ll ans = 0;
	ll a, b;
	a = d[0];
	b = 0;
	for (ll i = 0; i < n-1; ++i) {
		if (s[i] < s[i + 1]) {
			ans += d[i+1];
		}
	}
	cout << ans + d[n - 1];*/
	/*ll n, m;
	cin >> n >> m;
	double r;
	cin >> r;
	ll s[100000000];
	ll d = 0;
	ll w = 0;
	vector <pair<ll, ll>> res(100000000);
	for (ll i = 0; i < n; ++i) {
		if (i == d) {
			cin >> w;
			cin >> d;
		}

		res[i - 1].second = res[i].first + s[i] * r;
	}
	for (ll i = 0; i <= 100000000; ++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) << " ";
	}*/
}
