#include #include #include #include #include #include #include #include #include #define rep(i,l,n) for(lint i=l;i vi; typedef vector vli; typedef vector vvi; typedef pair pii; int main(){ int n; double b; cin>>n>>b; vector a(n); rep(i,0,n) cin>>a[i]; double x1=0,x2=0; rep(i,0,n){ x1+=a[i]*pow(b,a[i]-1.0); } rep(i,0,n){ if(abs(a[i]+1.0)<1e-12) x2+=log(b); else x2+=pow(b,a[i]+1.0)/(a[i]+1.0); } printf("%.10lf\n%.10lf\n",x1,x2); }