import kotlin.math.hypot fun main() { val (x, y, z, w) = readLine()!!.split(" ").map { it.toDouble() } var l = 0.0; var r = x; for (i in 0 until 100) { val ab = (l+r) / 2 val ad = x / ab if (hypot(ab, y) - hypot(ad, z) <= w) l = ab else r = ab } val ab = l val ad = x / ab val abp = ab * y / 2 val dpa = (ad-y) * (ab-z) / 2 val bcq = ad * z / 2 println(x - abp - dpa - bcq) }