#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, v, d, w, l;
  cin >> a >> v;
  cin >> l >> d >> w;
  double v2 = min(sqrt(2 * a * d), v);
  double t = 0.0;
  if (v2 <= w) {
    double s2 = v * v / (2 * a);
    if (s2 <= l) {
      t += v / a + (l - s2) / v;
    } else {
      t += sqrt(2 * l / a);
    }
  } else {
    double v3 = sqrt(a * d + w * w / 2);
    if (v3 <= v) {
      t += (2 * v3 - w) / a;
    } else {
      double x = d - (v * v - w * w) / (2 * a);
      double s4 = v * v / (2 * a);
      t += v / a + (x - s4) / v + (v - w) / a;
    }
    double s3 = (v * v - w * w) / (2 * a);
    if (s3 <= l - d) {
      t += (v - w) / a + (l - s3 - d) / v;
    } else {
      t += (sqrt(2 * a * (l - d) + w * w) - w) / a;
    }
  }
  cout << fixed << setprecision(7) << t;
  return 0;
}
