#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
double a, v, l, d, w;
double trap(double dist, double v0) {
  double acctime = (v - v0) / a;
  double accdist = v0 * acctime + a * acctime * acctime / 2.0;
  if (accdist >= dist) {
    double tm = (-v0 + sqrt(v0 * v0 + 2 * a * dist)) / a;
    return tm;
  }
  return acctime + (dist - accdist) / v;
}
int main() {
  scanf("%lf%lf%lf%lf%lf", &a, &v, &l, &d, &w);
  double speedat = min(min(w, v), sqrt(2.0 * a * d));
  double res = 0;
  double dist = d;
  res += speedat / a;
  dist -= speedat * speedat / a / 2.0;
  res += 2 * trap(dist / 2, speedat);
  res += trap(l - d, speedat);
  printf("%.10lf\n", res);
  return 0;
}
