#include <bits/stdc++.h>
using namespace std;
double distance(double v, double a, double t) { return v * t + a * t * t / 2; }
double time(double v, double a, double d) {
  return (-v + sqrt(v * v + 2 * a * d)) / a;
}
int main(int argc, char* argv[]) {
  cout.precision(16);
  double a, v, l, d, w;
  cin >> a >> v >> l >> d >> w;
  double t = 0;
  double p = (w * w + 2 * a * d) / (4 * a);
  if (p <= d) {
    if (sqrt(2 * p * a) <= v)
      t += sqrt(2 * p * a) / a + (sqrt(2 * p * a) - w) / a;
    else
      t +=
          v / a +
          (d - distance(0, a, v / a) - distance(v, -a, max(0.0, (v - w) / a))) /
              v +
          max(0.0, (v - w) / a);
    if (d + distance(w, a, max(0.0, (v - w) / a)) < l)
      t += max(0.0, (v - w) / a) +
           (l - d - distance(w, a, max(0.0, (v - w) / a))) / v;
    else
      t += time(w, a, l - d);
  } else {
    if (distance(0, a, v / a) < l)
      t += v / a + (l - distance(0, a, v / a)) / v;
    else
      t += time(0, a, l);
  }
  cout << t << endl;
  return 0;
}
