1 /**************************************************************
2 Problem: 1011
3 User: AsmDef
4 Language: C++
5 Result: Accepted
6 Time:1656 ms
7 Memory:2308 kb
8 ****************************************************************/
9
10 #include <cctype>
11 #include <cstdio>
12 #include <cmath>
13 #include <cstdlib>
14 using namespace std;
15 template<typename T>inline void getd(T &x){
16 char c = getchar(); bool minus = 0;
17 while(!isdigit(c) && c != ‘-‘)c = getchar();
18 if(c == ‘-‘)minus = 1, c = getchar();
19 x = c - ‘0‘;
20 while(isdigit(c = getchar()))x = x * 10 + c - ‘0‘;
21 if(minus)x = -x;
22 }
23 /*========================================================*/
24 const int maxn = 100002;
25 const double eps = 1e-12;
26 int N;
27 int main(){
28
29 //#undef DEBUG
30
31 double A, M[maxn], S[maxn];
32 #if defined DEBUG
33 freopen("test", "r", stdin);
34 freopen("out.txt", "w", stdout);
35 #else
36 //freopen("bzoj_1011_planet.in", "r", stdin);
37 //freopen("bzoj_1011_planet.out", "w", stdout);
38 #endif
39 getd(N);
40 int i, j, t, s;
41 double Ans, mid;
42 scanf("%lf", &A);
43 double lim = 1 / A;
44 S[0] = 0;
45 for(i = 1;i <= N;++i)
46 scanf("%lf", M + i), S[i] = S[i-1] + M[i];
47 printf("%.6lf\n", (double)0);
48 for(i = 2;i <= N;++i){
49 Ans = 0;
50 t = (int)(i * A + eps);
51 s = (int)(t - lim);
52 if(s > 1){
53 mid = (int)sqrt((double)(i-1) * (i-s+1));
54 Ans += M[i] * S[s-1] / mid;
55 }
56 else s = 1;
57 for(j = s;j <= t;++j)
58 Ans += M[i] * M[j] / (i - j);
59 printf("%.6lf\n", Ans + eps);
60 }
61
62 return 0;
63 }