from decimal import Decimal def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] x, y, z, w = map(int, input().split()) d = make_divisors(x) for i in d: oth = x // i if i < z or oth < y: continue try: if Decimal(str(y ** 2 + i ** 2)) ** Decimal("0.5") - Decimal(str(z ** 2 + oth ** 2)) ** Decimal("0.5") == Decimal(str(w)): print(x - y * i / 2 - z * oth / 2 - (i - z) * (oth - y) / 2) break except: continue