#include <bits/stdc++.h>
using namespace std;
double a, v, l, d, w, t = 0;
double solve(double v0, double v1, double vm, double a, double d) {
  if ((v1 + v0) * (v1 - v0) / a / 2 > d) {
    return sqrt(d * 2 / a + v0 * v0 / a / a) - v0 / a;
  } else {
    double dd = (vm + v0) * (vm - v0) / a / 2 + (vm + v1) * (vm - v1) / a / 2;
    if (d > dd) {
      return (vm - v0) / a + (vm - v1) / a + (d - dd) / vm;
    } else {
      return (2 * sqrt((a * d * 2 + v0 * v0 + v1 * v1) / 2) - v0 - v1) / a;
    }
  }
}
int main() {
  cin >> a >> v >> l >> d >> w;
  double res = solve(0, min(v, w), v, a, d) +
               solve(min(min(v, w), sqrt(d * a * 2)), v, v, a, l - d);
  cout.precision(15);
  cout << res << endl;
}
