using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var p = NList; var (l, r) = (p[0], p[1]); WriteLine(Abs(c, l, r)); } static double Abs(int[] c, int l, int r) { var list = new List(); list.Add(FD(c, l)); list.Add(FD(c, r)); if (c[3] != 0) { var rt = 4 * c[2] * c[2] - 12 * c[1] * c[3]; if (rt == 0) { var x = -c[2] / 3.0 / c[3]; if (x >= l && x <= r) list.Add(FD(c, x)); } else if (rt > 0) { var sq = Math.Sqrt(rt); var x1 = (-2 * c[2] + sq) / 6 / c[3]; if (x1 >= l && x1 <= r) list.Add(FD(c, x1)); var x2 = -(2 * c[2] + sq) / 6 / c[3]; if (x2 >= l && x2 <= r) list.Add(FD(c, x2)); } } else if (c[2] != 0) { var x = - c[1] / 2.0 / c[2]; if (x >= l && x <= r) list.Add(FD(c, x)); } list.Sort(); if (list[0] < 0 && list[^1] > 0) return 0; else return list.Select(Math.Abs).Min(); } static double FD(int[] c, double x) { return c[0] + c[1] * x + c[2] * x * x + c[3] * x * x * x; } }