#include "stdio.h" #include "stdlib.h" #include using namespace std; int main() { double tf, vf, hf, td, vd, hd; cin >> tf >> vf >> hf >> td >> vd >> hd; double t_fall = sqrt(2 * hf); double s_fall = t_fall * vf; if (vd <= vf) { printf("%f\n", td + (s_fall / vd) * 2); return 0; } double sf = vf * (td - tf); double t = sf / (vd - vf); if ((t + td - tf) >= t_fall) { printf("%f\n", td + (s_fall / vd) * 2); return 0; } double h = hf - 1/2 * (td - tf + t) * (td - tf + t); if (h <= hd) { printf("%f\n", td + t*2); return 0; } double t2 = sqrt(2 * (hf - hd)); double s2 = vf * t2; printf("%f\n", tf + t2 + s2/vd); return 0; }