#include <bits/stdc++.h>
using namespace std;
double Len, a, Limitv, Point, Maxv;
double tim, v0, vt;
int main() {
  scanf("%lf%lf%lf%lf%lf", &a, &Maxv, &Len, &Point, &Limitv);
  if (Limitv >= Maxv)
    Point = 0.;
  else {
    double s1 = Limitv * Limitv / (2 * a);
    if (s1 >= Point)
      v0 = sqrt(2 * a * Point), tim = v0 / a;
    else {
      double s2 = (Maxv - Limitv) * (Maxv + Limitv) / a;
      if (s1 + s2 >= Point)
        v0 = Limitv,
        tim = Limitv / a +
              (sqrt((Point - s1) * a + Limitv * Limitv) - Limitv) * 2 / a;
      else
        v0 = Limitv,
        tim = Limitv / a + (Maxv - Limitv) * 2 / a + (Point - s1 - s2) / Maxv;
    }
  }
  double tp = (Maxv - v0) * (Maxv + v0) / (2 * a);
  if (Len - Point >= tp)
    tim += (Maxv - v0) / a + (Len - Point - tp) / Maxv;
  else
    vt = sqrt(2 * a * (Len - Point) + v0 * v0), tim += (vt - v0) / a;
  printf("%0.12lf\n", tim);
}
