#include <bits/stdc++.h>
using namespace std;
double a, v, d, w, l, ans, mid, t2, t;
bool check(double maxv) {
  return d - ((maxv + w) / 2) * (((maxv - w) * 2) / a) > 1e-8;
}
int main() {
  scanf("%lf %lf %lf %lf %lf", &a, &v, &l, &d, &w);
  w = min(min(w, v), sqrt(2 * a * d));
  if (2 * a * d + w * w > 2 * v * v) {
    t = (d - v * v / a + w * w / a / 2) / v + (2 * v - w) / a;
  } else {
    t = (2 * sqrt(a * d + w * w / 2) - w) / a;
  }
  l = l - d;
  t2 = (v - w) / a;
  if (l - w * t2 - 0.5 * a * t2 * t2 > 0) {
    t2 = t2 + (l - w * t2 - 0.5 * a * t2 * t2) / v;
  } else {
    t2 = (-w + sqrt(w * w + 2.0 * a * l)) / a;
  }
  printf("%.10f\n", t + t2);
  return 0;
}
