#include <bits/stdc++.h>
void print(double a) { printf("%.12lf\n", a); }
int main(int argc, char **argv) {
  double a, v, l, d, w;
  scanf("%lf%lf%lf%lf%lf", &a, &v, &l, &d, &w);
  double posL = sqrt(2 * d * a);
  if (v <= w || posL <= w) {
    if (2 * l * a <= v * v)
      print(sqrt((2 * l) / a));
    else {
      double t = v / a;
      print(t + (l - a * t * t / 2) / v);
    }
  } else {
    double t1 = sqrt((2 * d * a + w * w) / (2 * a * a));
    double vel = a * t1;
    double halft;
    if (vel <= v) {
      halft = t1 + (vel - w) / a;
    } else {
      double t01 = v / a;
      double t03 = (v - w) / a;
      double t02 = (d - a * t01 * t01 / 2 - v * t03 + a * t03 * t03 / 2) / v;
      halft = t01 + t02 + t03;
    }
    double tf = (-w + sqrt(w * w + 2 * a * (l - d))) / (a);
    if (tf * a + w <= v) {
      print(halft + tf);
    } else {
      double nt = (v - w) / a;
      print(halft + nt + (l - d - w * nt - a * nt * nt / 2) / v);
    }
  }
  return 0;
}
