#include <iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<fstream>
#include<string>
#include<random>
#include<cmath>
#include<ctime>
#include<set>
#include<unordered_map>
#include<map>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
double binpow(double a, ll n) {
	if (n == 0)return 1.0;
	double res = binpow(a, n / 2);
	res *= res;
	if (n % 2 != 0)res *= a;
	return res;
}
int main()
{
	ios::sync_with_stdio(0);
	ll n, m;
	cin >> n >> m;
	double r;
	cin >> r;
	double di, wi;
	vector<double> oth(n+2), D(n), W(n);
	for (ll i = 0; i < n; ++i)
	{
		cin >> di >> wi;
		D[i] = di;
		W[i] = wi;
		oth[i+1] = oth[i]*(1.0-r) + wi*r;
	}
	oth[n + 1] = oth[n] * (1.0 - r);
	ll buf;
	cout.setf(ios::fixed);
	for (ll i = 0; i < m; ++i)
	{
		cin >> buf;
		cout.precision(12);
		--buf;
		if(buf<n+1)cout << oth[buf] << " ";
		else cout << oth[n] * binpow(1.0 - r, buf - n) << '\n';
	}
	return 0;
}