#include <bits/stdc++.h>
using namespace std;
double a, v;
double l, d, w;
inline int dcmp(const double &x) { return (x < -1e-7 ? -1 : (x > 1e-7)); }
void input() {
  cin >> a >> v;
  cin >> l >> d >> w;
}
void solve() {
  double ans, tmp;
  double vp;
  if (w >= v) {
    tmp = 0.5 * v * v / a;
    if (tmp >= l)
      ans = sqrt(2 * l / a);
    else
      ans = (v / a) + (l - tmp) / v;
  } else {
    tmp = sqrt(2 * a * d);
    if (tmp <= w) {
      tmp = 0.5 * v * v / a;
      if (tmp >= l)
        ans = sqrt(2 * l / a);
      else
        ans = (v / a) + (l - tmp) / v;
    } else {
      vp = sqrt(d * a + 0.5 * w * w);
      if (vp <= v) {
        ans = (2 * vp - w) / a;
      } else {
        tmp = (0.5 / a) * (2 * v * v - w * w);
        ans = (d - tmp) / v + v / a + (v - w) / a;
      }
      vp = (v - w) / a;
      tmp = w * vp + 0.5 * a * vp * vp;
      if (tmp + d >= l) {
        ans += (-w + sqrt(w * w - 2 * a * (d - l))) / a;
      } else {
        ans += vp + (l - d - tmp) / v;
      }
    }
  }
  printf("%.8lf\n", ans);
}
int main(void) {
  input();
  solve();
  return 0;
}
