#include #include #include #include #include #include #include using namespace std; #define REP(A,B) for(int (A)=0;(A)<(B);(A)++) #define ld long double int main() { double Tf, Vf, Hf, Td, Vd, Hd; scanf("%lf%lf%lf%lf%lf%lf", &Tf, &Vf, &Hf, &Td, &Vd, &Hd); ld tdrop = sqrt(2*Hf)+Tf; ld xdrop = Vf*(tdrop-Tf); ld tmeetx; if(Vf == Vd) { tmeetx = xdrop/Vd + Td; } else { tmeetx = (Vf*Tf-Vd*Td)/(Vf-Vd); if(tmeetx < Td || tmeetx > tdrop) tmeetx = xdrop/Vd + Td; } ld ymeetx = max(0.0L, Hf-(tmeetx-Tf)*(tmeetx-Tf)/2); if(ymeetx > Hd) { tmeetx = sqrt(2*(Hf-Hd))+Tf; ymeetx = Hd; } ld tjump = sqrt(2*Hd/3); ld vjump = 3*tjump; ld tfly = (vjump-sqrt(vjump*vjump-4*3/2.0*ymeetx))/3; ld thalf; if(Td+tfly > tmeetx) { ld b = Tf-vjump-3*Td; ld c = Hf-1/2.0*Tf*Tf+3/2.0*Td*Td; ld thalf1 = (-b-sqrt(b*b-4*c))/2; ld thalf2 = (-b+sqrt(b*b-4*c))/2; if(thalf1 > Td) { thalf = thalf1; } else thalf = thalf2; } else { thalf = tmeetx; } ld xhalf = min(Vf*(thalf-Tf), xdrop); ld T = thalf+xhalf/Vd; printf("%lf\n", (double)T); return 0; }