#include #define REP(i, n) for(int i =0; i < n; ++i) using namespace std; long double tf,t_dog,v_fris_x,v_dog_x,h_fris,h_dog, v_dog_y, t_dog_hd, t_fris_hd, t_chyt_x, t_pad, t_dobehne, t_chyt_y; bool spadne; long double yd(long double t){ if(t <= t_dog) return 0; if(t >= t_dog_hd) return h_dog; return (t-t_dog)*v_dog_y - 1.5*(t-t_dog); } long double xd(long double t){ if(t <= t_dog) return 0; return v_dog_x*(t-t_dog); } long double yf(long double t){ if(t <= t_pad) return h_fris - 0.5*t*t; return 0; } long double xf(long double t){ if(t <= t_pad) return v_fris_x*t; return v_fris_x*t_pad; } int main(){ long double res; cin >> tf >>v_fris_x>>h_fris>>t_dog>>v_dog_x>>h_dog; t_dog-=tf; t_pad = sqrt(2*h_fris); if(h_fris>=h_dog) t_fris_hd = sqrt(h_fris-h_dog); else t_fris_hd=0; long double t_mx = sqrt(2*h_dog/3); v_dog_y = 3*t_mx; t_dog_hd = t_mx + t_dog; t_chyt_x = (v_fris_x*t_dog)/(v_dog_x-v_fris_x)+t_dog; if(t_chyt_x < t_dog) spadne=true; t_dobehne = (v_fris_x*t_pad + v_dog_x*t_dog)/v_dog_x; /*double discr = (v_dog_y + 3*t_dog)*(v_dog_y+3*t_dog) - 4*(h_fris + v_dog_y*t_dog + 3*t_dog*t_dog/2); if(discr >= 0) t_chyt_y = 0.5*(v_dog_y + 3*t_dog - sqrt(discr)); if(spadne){ res = 2*t_dobehne - t_dog; } else{ double t; if(t_dog_hd <= t_fris_hd){ t = max(t_chyt_x, t_fris_hd); } else{ t = max(t_chyt_x, t_chyt_y); } double s = v_fris_x*t; res = 2*s/v_dog_x + t_dog; }*/ long double tmin = t_dog, tmax = 4*xf(t_pad)/v_dog_x + t_dog; while(tmax-tmin > 0.0000001){ long double tm = (tmax+tmin)/2; if(yd(tm) >= yf(tm) && xd(tm) >= xf(tm)) tmax = tm; else tmin = tm; } cout << setprecision(9) << (tf+tmin+xf(tmin)/v_dog_x) << endl; return 0; }