#include <bits/stdc++.h>
using namespace std;
double fmin(double x, double y) { return x - y > 1e-9 ? y : x; }
double a, v, l, d, k;
double dist(double u, double t) { return u * t + .5 * a * t * t; }
double move(double s, double u) {
  double A = .5 * a, B = u, C = -s;
  double t = (-B + sqrt(B * B - 4 * A * C)) / 2. / A;
  double q = (v - u) / a;
  if (q - t > -1e-9)
    return t;
  else
    return q + (s - dist(u, q)) / v;
}
int main(int argc, char **argv) {
  cin >> a >> v >> l >> d >> k;
  if (k - v > -1e-9) {
    printf("%.20f\n", move(l, 0));
  } else {
    double d2 = dist(0, k / a);
    if (d2 - d > -1e-9) {
      printf("%.20f\n", move(l, 0));
    } else
      printf("%.20f\n", k / a + 2 * move(.5 * (d - d2), k) + move(l - d, k));
  }
  return 0;
}
