#include #include #define lli long long int #define ld long double using namespace std; int main() { int tf, vf,hf, td, vd, hd; cin >> tf >> vf >> hf >> td >> vd >> hd; ld t1, t2; t1 = +tf + sqrt( tf*tf + 2 * (hf-tf*tf/2)); t2 = +tf - sqrt( tf*tf + 2 * (hf-tf*tf/2)); ld tdistance = (vf*tf-vd*td)/(vf-vd); ld th1, th2; th1 = +tf + sqrt( tf*tf + 2 * (hf-tf*tf/2 -hd)); th2 = tf - sqrt( tf*tf + 2 * (hf-tf*tf/2 -hd)); //cout << "t1 " << t1 << " t2 " << t2 << endl; //cout << "th1 " << th1 << " th2 " << th2 << endl; ld tdopad, theight; tdopad = t1 > t2 ? t1 : t2; theight = th1 > th2 ? th1 : th2; //ld result; if (tdistance > tdopad && tdistance < theight) { cout << theight*vf + theight*vf/vd << endl; } else if (tdistance > tdopad) { cout << ( 2* ( (vf*tdopad+vd*td) /vd) ) << endl; } else { cout << 2*tdistance << endl; } return 0; }