#include <bits/stdc++.h>   int main(void) {     double a, v, l, d, w, t = 0;     scanf( %lf%lf%lf%lf%lf , &a, &v, &l, &d, &w);     if (2 * a * d <= w * w || w >= v) {       if (l * a * 2 >= v * v) {         t += v / a;         t += (l - v * v / (2 * a)) / v;       } else {         t += sqrt(2 * l / a);       }     } else if (2 * a * d >= 2 * v * v - w * w) {       t += v / a;       t += (v - w) / a;       t += (d - (2 * v * v - w * w) / (2 * a)) / v;       if (2 * a * (l - d) > v * v - w * w) {         t += (v - w) / a;         t += (l - d - (v * v - w * w) / (2 * a)) / v;       } else {         t += sqrt(2 * (l - d) / a + w * w / (a * a)) - w / a;       }     } else {       t += (sqrt(a * d + w * w / 2) + sqrt(a * d + w * w / 2) - w) / a;       if (2 * a * (l - d) > v * v - w * w) {         t += (v - w) / a;         t += (l - d - (v * v - w * w) / (2 * a)) / v;       } else {         t += sqrt(2 * (l - d) / a + w * w / (a * a)) - w / a;       }     }     printf( %f n , t);     return 0;   }   