x, y, z, w = map(int, input().split()) def is_ok(k): p = ((k+w)**2-y**2)*(k**2-z**2) return p >= x**2 ng = 0 ok = 2*x while abs(ng-ok) > 10**(-9): mid = (ng+ok)/2 if is_ok(mid): ok = mid else: ng = mid k = ok import math a = math.sqrt((k+w)**2-y**2) b = math.sqrt(k**2-z**2) ans = x-y*a/2-b*z/2-(b-y)*(a-z)/2 print(ans)