#include <bits/stdc++.h>
using namespace std;
long double a, vm, l, d, w;
long double full_speed(long double v0, long double x) {
  long double x1 = (vm * vm - v0 * v0) / 2 / a;
  if (x <= x1)
    return (sqrt(v0 * v0 + 2 * a * x) - v0) / a;
  else
    return (vm - v0) / a + (x - x1) / vm;
}
int main() {
  cin >> a >> vm >> l >> d >> w;
  long double t_min;
  long double w_square = w * w, d_veloc = 2 * a * d;
  if (w_square >= d_veloc || (d_veloc > w_square && w_square >= vm * vm))
    t_min = full_speed(0, l);
  else {
    if (2 * vm * vm >= w_square + d_veloc)
      t_min = (sqrt(2 * w_square + 2 * d_veloc) - w) / a + full_speed(w, l - d);
    else
      t_min = (vm - w) / a + d / vm + w_square / (2 * a * vm) +
              full_speed(w, l - d);
  }
  cout << fixed << setprecision(10) << t_min << endl;
  return 0;
}
