C=list(map(int,input().split())) L,R=map(int,input().split()) def f(x): ans=0 for i in range(4): ans+=C[i]*(x**i) return abs(ans) ans=10**20 add=1e-5 while L<=R: ans=min(ans,f(L)) L+=add print("{:.10f}".format(ans))