#include #include #include using namespace std; double tf, vf, hf, td, vd, hd; int main() { cin >> tf; cin >> vf; cin >> hf; cin >> td; cin >> vd; cin >> hd; double res; double s = sqrt((hf - hd)* 2) * vf; //cout << "s: "<< s << endl; double sdm = sqrt((2* hd) /3)* vd; //cout << "sdm: "<< sdm << endl; if(s < sdm) { double a = 3/ (2 * vd* vd) - 1/ (2* vf *vf); //cout << "a: "<< a << endl; double vj = sqrt(2*hd*3); //cout << "vj: "<< vj << endl; double b = -vj / vd; //cout << "b: "<< b << endl; double s1 = (-b + sqrt(b*b - 4*a*hf)) / (2*a); double s2 = (-b - sqrt(b*b - 4*a*hf)) / (2*a); //cout << "s1: "<< s1 << endl; //cout << "s2: "<< s2 << endl; if(s1 < 0) s = s2; else if(s2 < 0) s = s1; else if(s1 < s2) s = s1; else s = s2; //cout << "s: "<< s << endl; } double tle = sqrt(2*hf); //cout << "tle: "<< tle << endl; if(vd <= vf) { res = 2*tle*vf / vd +td; } else { double t = (tf*vf - td * vd) / (vf - vd); //cout << "t: "<< t << endl; if(t > tle) res = 2*tle*vf / vd +td; else if((t-td)*vd < s) res = tf + s/vf+s/vd; else res = (t- td)*2+td; } cout << res << endl; return 0; }