#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int c0, c1, c2, c3; cin >> c0 >> c1 >> c2 >> c3; int l, r; cin >> l >> r; auto f = [&](double x) { return c0 + c1 * x + c2 * x * x + c3 * x * x * x; }; double mi = min(f(l), f(r)); double ma = max(f(l), f(r)); if (c3 != 0 && 4 * c2 * c2 - 12 * c1 * c3 >= 0) { double d = sqrt(4 * c2 * c2 - 12 * c1 * c3); double x1 = (-2 * c2 + d) / (6 * c3); double x2 = (-2 * c2 - d) / (6 * c3); if (l <= x1 && x1 <= r) { mi = min(mi, f(x1)); ma = max(ma, f(x1)); } if (l <= x2 && x2 <= r) { mi = min(mi, f(x2)); ma = max(ma, f(x2)); } } else if (c3 == 0 && c2 != 0) { double x = (double)c1 / (2 * c2); if (l <= x && x <= r) { mi = min(mi, f(x)); ma = max(ma, f(x)); } } if (mi * ma <= 0) { cout << fixed << setprecision(16) << 0.0 << endl; } else { cout << fixed << setprecision(16) << min(abs(mi), abs(ma)) << endl; } }