#include <bits/stdc++.h>
#define ll long long
#define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pb push_back


using namespace std;


int main()
{
    speed;
    ll left,right,mid;
    ll d,q,n,m;
    long double w,r,ans=0;
    cin>>n>>m>>r;
    vector<pair<ll,long double>> a,g;
    for(int i=0;i<n;i++)
    {
        cin>>d>>w;
        a.pb(make_pair(d,w));
    }
    vector<ll> days(m);
    for(int i=0;i<m;i++)
    {
        cin>>days[i];
    }
    sort(a.begin(),a.end());
    sort(days.begin(),days.end());
    g.pb(make_pair(a[0].first,a[0].second*r));
    for(int i=1;i<a.size();i++)
    {
        g.pb(make_pair(a[i].first,g[i-1].second*pow(r,a[i].first-a[i-1].first)+a[i].second*r));
    }
    for(int i=0;i<m;i++)
    {
        if(days[i]<g[0].first)
        {
            cout<<0<<" ";
        }
        else if(days[i]<=g[g.size()-1].first)
        {
            left=-1;
            right=g.size();
            while(right-left!=1)
            {
                mid=(left+right)/2;
                if(g[mid].first>days[i])
                {
                    right=mid;
                }
                else
                {
                    left=mid;
                }
            }
            cout<<g[left].second*pow(r,days[i]-left)<<" ";
        }
        else
        {
            cout<<g[g.size()-1].second*pow(r,days[i]-g[g.size()-1].first)<<" ";
        }
    }
    return 0;
}