#include #include #include #include using namespace std;double sum=0.0,p,r;int n,ReAmount[100000];vector > v(100000);void BFS(int u){ int queue[100000],front=0,rear=0; int level=0,s,last,temp; queue[rear++]=u; last=u; while(front!=rear) { s=queue[front++]; if(v[s].size()==0) sum+=ReAmount[s]*pow((1+r/100),level)*p; for(auto it=v[s].begin();it!=v[s].end();++it) { queue[rear++]=*it; temp=*it; } if(last==s) { ++level; last=temp; } }}int main(){ cin>>n>>p>>r; for(int i=0;i >k; if(k) { while(k--) { cin>>temp; v[i].push_back(temp); } } else { cin>>temp; ReAmount[i]=temp; } } BFS(0); printf("%.1lf",sum); return 0;}