#include using namespace std; const double INF = 10000000; int main(){ int C0, C1, C2, C3; cin >> C0 >> C1 >> C2 >> C3; int L, R; cin >> L >> R; if (C3 == 0 && C2 == 0 && C1 == 0){ cout << abs(C0) << endl; } else { vector X = {L, R}; if (C3 != 0){ double a = C3 * 3, b = C2 * 2, c = C1; if (b * b - 4 * a * c >= 0){ for (int sgn : {-1, -1}){ double x = (-b + sgn * sqrt(b * b - 4 * a * c)) / 2; if (L <= x && x <= R){ X.push_back(x); } } } } else if (C2 != 0){ double x = -C1 / (C2 * 2); if (L <= x && x <= R){ X.push_back(x); } } sort(X.begin(), X.end()); int cnt = X.size(); auto f = [&](double x){ return ((x * C3 + C2) * x + C1) * x + C0; }; double ans = INF; for (int i = 0; i < cnt; i++){ ans = min(ans, abs(f(X[i]))); } for (int i = 0; i < cnt - 1; i++){ if (f(X[i]) * f(X[i + 1]) < 0){ ans = 0; } } cout << ans << endl; } }