Everybody knows that the capital of Berland is connected to Bercouver (the Olympic capital) by a direct road. To improve the road's traffic capacity, there was placed just one traffic sign, limiting the maximum speed. Traffic signs in Berland are a bit peculiar, because they limit the speed only at that point on the road where they are placed. Right after passing the sign it is allowed to drive at any speed.

It is known that the car of an average Berland citizen has the acceleration (deceleration) speed of *a* km/h<sup class="upper-index">2</sup>, and has maximum speed of *v* km/h. The road has the length of *l* km, and the speed sign, limiting the speed to *w* km/h, is placed *d* km (1 ≤ *d* &lt; *l*) away from the capital of Berland. The car has a zero speed at the beginning of the journey. Find the minimum time that an average Berland citizen will need to get from the capital to Bercouver, if he drives at the optimal speed.

The car can enter Bercouver at any speed.
The first line of the input file contains two integer numbers *a* and *v* (1 ≤ *a*, *v* ≤ 10000). The second line contains three integer numbers *l*, *d* and *w* (2 ≤ *l* ≤ 10000; 1 ≤ *d* &lt; *l*; 1 ≤ *w* ≤ 10000).
import math
a0,v0=input().split()
a,v,t=float(a0),float(v0),0#a为车的最大加速度 v为车的最大速度
l0,d0,w0=input().split()
l,d,w=float(l0),float(d0),float(w0)#l,d,w分别为总路程、限速牌距离起点的距离、限制速度
#在限制点后直接以最大加速度行驶即可
#在限制点前，汽车可能一直加速，也可能先加速后减速，临界状况在 min(v,w)^2=2*a*d
if v>w:
    if w**2>=2*a*d:#一直加速到限制点即可的情况
        t+=math.sqrt(2*a*d)/a
        v_now=math.sqrt(2*a*d)
    else:#先加速到达w
        t+=w/a#加速时间
        v_now=w
        if (v**2-w**2)/a<=(d-v_now**2/(2*a)):#可以直接先加速到v再匀速最后减速到w的情况
            t+=2*(v-w)/a#加速
            t+=(d-v_now**2/(2*a)-(v**2-w**2)/a)/v#匀速
        else:
            #最大速度计算:a*(d-(w**2/(2*a)))=vm**2-w**2
            vm=math.sqrt((w**2+a*(d-(v_now**2/(2*a)))))
            t+=2*((vm-w)/a)
    if v**2-v_now**2>2*a*(l-d):#后程一直加速的情况
        t+=(math.sqrt(v_now**2+2*a*(l-d))-v_now)/a
    else:
        t+=(v-v_now)/a#加速时间
        t+=(l-d-(v**2-v_now**2)/(2*a))/v#匀速时间
else:#v<w的情况，只需要一直加速后匀速即可
    if v**2/(2*a)>=l:#一直加速
        t+=math.sqrt(2*l/a)
    else:
        t+=v/a#加速
        t+=(l-v**2/(2*a))/v#匀速
print('%.5f'%t)