/************************************************************** Problem: 1011 User: whymhe Language: C++ Result: Accepted Time:1824 ms Memory:2852 kb ****************************************************************/ #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int N=1e5+5; const double eps=1e-8; int n; double a,m[N],sum[N]; double ans; int main() { scanf("%d%lf",&n,&a); for(int i=1;i<=n;++i) { scanf("%lf",m+i); sum[i]=sum[i-1]+m[i]; } int bound=min(2000,n); for(int i=1;i<=bound;++i) { double ans=0; int j=(int)((double)i*a+eps); for(;j;--j) ans+=m[j]/(double)(i-j); // cout<<ans*m[i]<<' '; printf("%.6lf ",ans*m[i]); } for(int i=bound+1;i<=n;++i) { int j=(int)((double)i*a+eps); double ans=sum[j]*m[i]/(double)(i-0.5*j); // cout<<ans<<' '; printf("%.6lf ",ans); } return 0; }