#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)); double d0 = c1, d1 = 2 * c2, d2 = 3 * c3; if (d2 != 0) { double D = d1 * d1 - 4 * d0 * d2; if (D > 0) { double x1 = (-d1 + sqrt(D)) / (2 * d2); double x2 = (-d1 - sqrt(D)) / (2 * d2); if (x1 > l && x1 < r) { mi = min(mi, f(x1)); ma = max(ma, f(x1)); } if (x2 > l && x2 < r) { mi = min(mi, f(x2)); ma = max(ma, f(x2)); } } } else if (d1 != 0) { double x = -d0 / d1; if (x > l && x < r) { mi = min(mi, f(x)); ma = max(ma, f(x)); } } if (mi <= 0 && ma >= 0) { cout << setprecision(16) << fixed << 0.0 << endl; } else { cout << setprecision(16) << fixed << min(abs(mi), abs(ma)) << endl; } }