import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string; auto rdsp(){return readln.splitter;} void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;} void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);} void readC(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=rdsp;foreach(ref v;t)pick(r,v[i]);}} void main() { int n; readV(n); double[] l; readC(n+2, l); auto l0 = l[0], lc = l.cumulativeSum; auto ll = new double[](n+2), lr = new double[](n+2); ll[1] = l[1]; foreach (i; 2..n+2) ll[i] = max(ll[i-1], l[i]); lr[n+1] = l[n+1]; foreach_reverse (i; 1..n+1) lr[i] = max(lr[i+1], l[i]); writeln(0); foreach (i; 2..n) { auto a = lc[1..i+1], b = max(2*ll[i]-a, 0); auto c = lc[i+1..$], d = max(2*lr[i+1]-c, 0); auto a2 = a^^2, b2 = b^^2, c2 = c^^2, d2 = d^^2; double f(double x) { auto ay = 0.0L, by = 0.0L, cy = 0.0L, dy = 0.0L; if (-a < x && x < a) ay = a2-x^^2; if (-b < x && x < b) by = b2-x^^2; if (l0-c < x && x < l0+c) cy = c2-(x-l0)^^2; if (l0-d < x && x < l0+d) dy = d2-(x-l0)^^2; return max(0.0L, min(ay, cy).sqrt-max(by, dy).sqrt); } writefln("%.7f", simpson!double((x) => f(x), -a, l0+c, 10^^5)*2); } writeln(0); } class CumulativeSum(T) { size_t n; T[] s; this(T[] a) { n = a.length; s = new T[](n+1); s[0] = T(0); foreach (i; 0..n) s[i+1] = s[i] + a[i]; } T opSlice(size_t l, size_t r) { return s[r]-s[l]; } size_t opDollar() { return n; } } auto cumulativeSum(T)(T[] a) { return new CumulativeSum!T(a); } T simpson(T)(T delegate(T) f, T a, T b, T k = 10^^6) { auto eps = (b-a)/k; auto c = f(a)+f(a+eps*k); for (auto i = 1; i < k; i += 2) c += f(a+eps*i)*4; for (auto i = 2; i < k; i += 2) c += f(a+eps*i)*2; return c*eps/3; } T integrate(T)(T delegate(T) f, T lo, T hi, T eps = 1e-8) { import std.math; const auto th = eps / 1e-14; T rec(T x0, T x6, T y0, T y6, int d) { const auto a = sqrt(2.0/3.0), b = 1.0 / sqrt(5.0); auto x3 = (x0+x6)/2, y3 = f(x3), h = (x6-x0)/2; auto x1 = x3-a*h, x2 = x3-b*h, x4 = x3+b*h, x5 = x3+a*h; auto y1 = f(x1), y2 = f(x2), y4 = f(x4), y5 = f(x5); auto i1 = (y0 + y6 + (y2 + y4) * 5) * (h/6); auto i2 = ((y0 + y6) * 77 + (y1 + y5) * 432 + (y2 + y4) * 625 + y3 * 672) * (h/1470); if (x3 + h == x3 || d > 50) return 0.0; if (d > 4 && th + (i1 - i2) == th) return i2; return rec(x0, x1, y0, y1, d+1) + rec(x1, x2, y1, y2, d+1) + rec(x2, x3, y2, y3, d+1) + rec(x3, x4, y3, y4, d+1) + rec(x4, x5, y4, y5, d+1) + rec(x5, x6, y5, y6, d+1); } return rec(lo, hi, f(lo), f(hi), 0); }