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

using namespace std;
using ll = long long;

int main()
{
	cin.tie(0); cout.tie(0);
	cout.precision(8); cin.precision(8);
	ll n, m; cin >> n >> m;
	double k; cin >> k;
	double q;
	ll p;
	vector <double> a(100114);
	for (ll i = 0; i < n; i++) {
		cin >> p >> q;
		a[p] = q;
	}
	vector <pair <double, double>> b(100114);
	for (ll i = 1; i <= 100113; i++) {
		b[i].first = b[i - 1].second * double(1 - k);
		b[i].second = b[i].first + a[i] * double(1 - k);
	}
	for (ll i = 0; i < m; i++) {
		cin >> p;
		cout << b[p].second << ' ';
	}
}