#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
const int N=1e5+10;
int n;
double P,R;
int p[N],f[N];
int dfs(int u){
if(f[u]!=-1) return f[u];
if(p[u]==-1) return f[u]=0;
return f[u]=dfs(p[u])+1;
}
int main(){
cin>>n>>P>>R;
for(int i=0;i<n;i++) cin>>p[i];
memset(f,-1,sizeof f);
int depth=0,cnt=0;
for(int i=0;i<n;i++){
if(dfs(i)>depth){
depth=dfs(i);
cnt=1;
}
else if(dfs(i)==depth) cnt++;
}
printf("%.2lf %d\n",P*pow(1+R/100,depth),cnt);
return 0;
}
08-16
332
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-20
320
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-17
301
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-17
564
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)