#include <iostream>
#include <iomanip>
using namespace std;
   int n, m, a[100005] = {0};
    int q[100005];
   long double w[200005], r;
int main()
{

    cin >> n >> m;
    cin >> r;
    for(int i = 0, j; i < n; i++)
    {
        cin >> j;
        cin >> a[j];
    }
    for(int i = 0; i < m; i++)
        cin >> q[i];
    int mx = 0;
    for(int i = 0; i < m; i++)
        if(mx < q[i] && q[i] < 200000) mx = q[i];
        int j = 0;
    for(int i = 1; i <= mx; i++)
    {

        w[i] = (1.0 - r) * w[i - 1] + r * a[i];
        j = i;

    }
    for(int i = 0; i < m; i++)
        if(q[i] < 200000)
        cout << fixed << setprecision(6) << w[q[i]] << " ";
    else cout << "0 ";
    return 0;
}
