#include <bits/stdc++.h>
bool ApproxEqual(double A, double B) { return fabs(A - B) < 0.00001; }
int main() {
  double Acceleration, VelocityLimit;
  double Distance, StopDistance, StopLimit;
  scanf(" %lf %lf %lf %lf %lf ", &Acceleration, &VelocityLimit, &Distance,
        &StopDistance, &StopLimit);
  double Time = 0.0;
  double MaxVelocityPossibleAtStop =
      fmin(VelocityLimit, sqrt(2 * Acceleration * StopDistance));
  double VelocityAtStop;
  if (MaxVelocityPossibleAtStop <= StopLimit) {
    if (ApproxEqual(MaxVelocityPossibleAtStop, VelocityLimit)) {
      Time += VelocityLimit / Acceleration;
      double DistanceRemainedToStop =
          StopDistance - VelocityLimit * VelocityLimit / (Acceleration * 2.0);
      Time += DistanceRemainedToStop / VelocityLimit;
    } else {
      Time += MaxVelocityPossibleAtStop / Acceleration;
    }
    VelocityAtStop = MaxVelocityPossibleAtStop;
  } else {
    double MaxVelocity =
        sqrt(Acceleration * StopDistance + StopLimit * StopLimit / 2.0);
    if (MaxVelocity > VelocityLimit) {
      Time += VelocityLimit / Acceleration;
      double MiddleDistance =
          StopDistance -
          (2 * VelocityLimit * VelocityLimit - StopLimit * StopLimit) /
              (Acceleration * 2.0);
      Time += MiddleDistance / VelocityLimit;
      Time += (VelocityLimit - StopLimit) / Acceleration;
    } else {
      Time += MaxVelocity / Acceleration;
      Time += (MaxVelocity - StopLimit) / Acceleration;
    }
    VelocityAtStop = StopLimit;
  }
  double AccelerationDistance =
      (VelocityLimit * VelocityLimit - VelocityAtStop * VelocityAtStop) /
      (Acceleration * 2.0);
  if (AccelerationDistance < Distance - StopDistance) {
    Time += (VelocityLimit - VelocityAtStop) / Acceleration;
    Time += (Distance - StopDistance - AccelerationDistance) / VelocityLimit;
  } else {
    double EndVelocity = sqrt(VelocityAtStop * VelocityAtStop +
                              2.0 * Acceleration * (Distance - StopDistance));
    Time += (EndVelocity - VelocityAtStop) / Acceleration;
  }
  printf("%.12lf", Time);
}
