C0, C1, C2, C3 = gets.split.map(&:to_f) L, R = gets.split.map(&:to_f) candidates = [L, R] # 微分する f'(x) = ax2 + bx + c a = 3 * C3 b = 2 * C2 c = C1 if a != 0 d = b**2 - 4 * a * c if d >= 0 candidates << (-b + Math.sqrt(d)) / (2 * a) candidates << (-b - Math.sqrt(d)) / (2 * a) end else if b != 0 candidates << (-c / b) end end candidates.filter! { L <= _1 and _1 <= R } ans = candidates.map { |x| (C0 + (C1 + (C2 + C3 * x) * x) * x).abs }.min puts ans