#include <bits/stdc++.h> 
#define ll long long 
#define f first 
#define s sceond 
using namespace std; 
 
int main() 
{ 
 
     unsigned long long n,m; 
      cin >> n >>m; 
      double r; 
      cin >> r; 
      unsigned long long ans=0; 
     
       map<unsigned long long,unsigned long long> a; 
     for (int i=0;i<n;i++) { 
        unsigned long long now; 
        unsigned long long now1; 
         cin >> now >> now1; 
         a[now-1]=now1; 
     } vector <unsigned long long> s(m); 
      
     for (unsigned long long i=0;i<m;i++) {  
         cin >> s[i]; 
     }  unsigned long long sum=s[m-1]; 
       map <unsigned long long,double> ans1; 
       cout << setprecision(8); 
         if (r==0) { 
          cout << 0; 
          return 0; 
      } 
     for (unsigned long long i=0;i<sum;i++) { 
          if (i==0) { 
              ans1[i]=r*a[i]; 
         }else {  
           ans1[i]=r*a[i]+(1.0-r)*ans1[i-1]; 
         } 
        // if (i!=0 && a[i].first==double(i)+1.0) { 
       //ans1[i]=r*a[i].second+(1.0-r)*ans1[i-1]; 
        // } else if (i!=0 && a[i].first!=double(i)+1.0 ) { 
        //     ans1[i]=(1.0-r)*ans1[i-1]; 
        // } else if (i==0 && a[i].first==1.0) { 
        //      ans1[i]=r*a[i].second; 
        // } else if (i==0 && a[i].first!=1.0) { 
         //    ans1[i]=0.0; 
        // }  
         
     }  
     for (auto now : s) { 
         cout << ans1[now-1] << " "; 
     } 
    return 0; 
}