#include #define FOR(i,a,b) for(int i = a; i < b; ++i) #define FORD(i,a,b) for(int i = a; i >= b; --i) #define pi pair #define ppi pair #define vi vector #define vvi vector #define fi first #define se second #ifndef DEBUG #define endl (char)10 #endif using namespace std; using ll = long long; using ld = long double; int main (){ ios_base::sync_with_stdio(false); cout.tie(0); cin.tie(0); //init(); /* ld T[6]; FOR(i,0,6) cin >> T[i]; ld tthd = sqrt(2 * (T[2] - T[5])); ld xohd = T[1] * tthd; ld tfdtx = T[3] - T[0] + xohd / T[4]; cout << fixed << setprecision(22); if (tfdtx <= tthd){ cout << T[0] + tthd + xohd / T[4] << endl; return 0; } ld ttref = sqrt(2 * T[2]); ld endx = T[1] * ttref; ld ttre = T[3] - T[0] + endx / T[4]; if (ttre > ttref){ cout << T[0] + ttre + endx / T[4] << endl; return 0; } ld ct = (T[3] - T[0]) * T[1] / (T[4] - T[1]); cout << T[0] + 2 * ct + T[3] - T[0] << endl; return 0; * */ ld T[6]; FOR(i,0,6) cin >> T[i]; cout << fixed << setprecision(22); ld ttref = sqrt(2 * T[2]); ld endx = T[1] * ttref; ld ttre = T[3] - T[0] + endx / T[4]; if (ttre > ttref){ cout << T[0] + ttre + endx / T[4] << endl; return 0; } ld tb = T[3] - T[0], te = ttref, ts, tp; ld vz = sqrt (6 * T[5]); while(te > tb + 1e-8){ ts = (te + tb) / 2; tp = ts - T[3] + T[0]; if (T[2] - ts * ts / 2 > (tp <= vz / 3 ? vz * tp - 1.5 * tp * tp : T[5]) || T[1] * ts > T[4] * (ts - T[3] + T[0])){ tb = ts; } else te = ts; } ld xz = T[1] * ts; cout << T[0] + ts + xz / T[4] << endl; return 0; }