#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<; using vi = vector; using vll = vector; int N, L0; vi L; pair radius(int l, int r) { double sm = accumulate(L.begin() + l, L.begin() + r, 0.0); double ma = *max_element(L.begin() + l, L.begin() + r); return mp(sm, max(2 * ma - sm, 0.0)); } double area(double r1, double r2) { if (r1 + r2 <= L0)return 0; if (L0 + r2 <= r1)return r2 * r2 * M_PI; if (L0 + r1 <= r2)return r1 * r1 * M_PI; // 余弦定理から角度を求める double t1 = acos((r1 * r1 + L0 * L0 - r2 * r2) / (2 * r1 * L0)) * 2; double t2 = acos((r2 * r2 + L0 * L0 - r1 * r1) / (2 * r2 * L0)) * 2; // 弓形の面積 // 角度が180度未満の時 // (扇形の面積)ー(三角形の面積) // 角度が180度を越える時 // (扇形の面積)+(三角形の面積) // π<θ<2πのときsin(θ)は負なので // 面積も負になるためうまく計算できる。 double res = 0; res += 0.5*r1*r1*(t1 - sin(t1)); res += 0.5*r2*r2*(t2 - sin(t2)); return res; } void solve() { cin >> N >> L0; L.resize(N + 1); rep(i, N + 1)cin >> L[i]; for (int i = 1; i <= N; ++i) { double R1, r1, R2, r2; tie(R1, r1) = radius(0, i); tie(R2, r2) = radius(i, N + 1); double ans = area(R1, R2) - area(R1, r2) - area(r1, R2) + area(r1, r2); cout << ans << endl; } } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); solve(); return 0; }