#include #include using namespace std; double PI = acos(0) * 2.0; void fill_max_min(const vector &Ls, int N, vector &max0, vector &min0){ max0[0] = Ls[0]; min0[0] = Ls[0]; int largest = Ls[0]; for (int i = 1; i <= N; ++i){ largest = max(largest, Ls[i]); max0[i] = max0[i - 1] + Ls[i]; min0[i] = max(2 * largest - max0[i], 0); } } double area(int C, int A, int B){ if (C >= A + B) return 0.0; if (A >= C + B) return PI * B * B; if (B >= C + A) return PI * A * A; double a = A; double b = B; double c = C; double theta = acos((b * b + c * c - a * a)/(2 * b * c)); double phi = acos((a * a + c * c - b * b)/(2 * a * c)); return b * b * (theta - sin(2 * theta)/2.0) + a * a * (phi - sin(2 * phi)/2.0); } double calc_area(int f, int a, int b, int c, int d){ // x, y // a^2 < x^2 + y^2 < b^2 // c^2 < (x-f)^2 + y^2 < d^2 // B and D - (A and D) - (C and B) + (A and C) return area(f, b, d) - area(f, a, d) - area(f, b, c) + area(f, a, c); } int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L0; cin >> N >> L0; vector Ls(N + 1, 0); for (auto & L : Ls) cin >> L; vector result(N, 0); vector max0(N + 1, 0); vector max1(N + 1, 0); vector min0(N + 1, 0); vector min1(N + 1, 0); fill_max_min(Ls, N, max0, min0); reverse(Ls.begin(), Ls.end()); fill_max_min(Ls, N, max1, min1); reverse(max1.begin(), max1.end()); reverse(min1.begin(), min1.end()); for (int i = 1; i < N; ++i){ result[i] = calc_area(L0, min0[i], max0[i], min1[i+1], max1[i+1]); } cout.precision(6); cout << fixed; for (auto a : result) cout << a << '\n'; return 0; }