double a,t,s;b;main(){for(scanf("%*d%d",&b);~scanf("%lf",&a);t+=(a+=1)?pow(b,a)/a:log(b))s+=a*pow(b,a-1);b=!printf("%f\n%f",s,t);}