using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static double[] NList => ReadLine().Split().Select(double.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (x, y, z, w) = (c[0], c[1], c[2], c[3]); var ok = z; var ng = x / y; while (ok - ng > 0.0000001) { var mid = (ok + ng) / 2; var bp = Math.Sqrt(mid * mid + y * y); var bq = Math.Sqrt(x / mid * x / mid + z * z); if (bp >= bq + w) ok = mid; else ng = mid; } WriteLine(x - ok * y / 2 - x / ok * z / 2 - (ok - z) * (x / ok - y) / 2); } }