#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;
}
signed main(){
	ld n, m;
	cin >> n >> m;
	ld r;
	cin >> r;
	vector <ld> s(1e5, 0);
	vector <pair<ld, ld>> res(1e5);
	for (ld i = 0; i < n; ++i) {
		ld d, w;
		cin >> d >> w;
		s[d - 1] = w;
	}
	for (ld i = 0; i < 1e5-1; ++i) {
		res[i].second = res[i].first + s[i] * r;
		res[i + 1].first = res[i].second * (1 - r);
	}
	vector <ld> q(m);
	for (ld i = 0; i < m; ++i) {
		cin >> q[i];
		cout  << setprecision(182) << (res[q[i] - 1].second) << " ";
	}
	
}
