#include <bits/stdc++.h>
using namespace std;
class Solution {
  double acceleration, maxSpeed, roadLength, signPlace, speedOfSign;

 public:
  void run() {
    cin >> acceleration >> maxSpeed >> roadLength >> signPlace >> speedOfSign;
    speedOfSign = min(speedOfSign, maxSpeed);
    double ans = 0;
    auto sq = [](double x) { return x * x; };
    double minLengthToReachMaxSpeedAndCoolDownToSpeedOfSign =
        (sq(maxSpeed) + sq(maxSpeed) - sq(speedOfSign)) / 2 / acceleration;
    double speedAtSign;
    if (signPlace >= minLengthToReachMaxSpeedAndCoolDownToSpeedOfSign) {
      ans += maxSpeed / acceleration;
      ans += (maxSpeed - speedOfSign) / acceleration;
      ans += (signPlace - minLengthToReachMaxSpeedAndCoolDownToSpeedOfSign) /
             maxSpeed;
      speedAtSign = speedOfSign;
    } else {
      double minLengthToReachMaxSpeedOfSign =
          sq(speedOfSign) / 2 / acceleration;
      if (signPlace >= minLengthToReachMaxSpeedOfSign) {
        double area = signPlace - minLengthToReachMaxSpeedOfSign;
        ans += (sqrt(sq(speedOfSign) + area * acceleration) - speedOfSign) /
               acceleration * 2;
        ans += speedOfSign / acceleration;
        speedAtSign = speedOfSign;
      } else {
        speedAtSign = sqrt(2 * acceleration * signPlace);
        ans += speedAtSign / acceleration;
      }
    }
    double minLengthToReachEndWithFullSpeed =
        (sq(maxSpeed) - sq(speedAtSign)) / 2 / acceleration;
    if (roadLength - signPlace >= minLengthToReachEndWithFullSpeed) {
      ans += (maxSpeed - speedAtSign) / acceleration;
      ans += (roadLength - signPlace - minLengthToReachEndWithFullSpeed) /
             maxSpeed;
    } else {
      ans +=
          (sqrt(2 * acceleration * (roadLength - signPlace) + sq(speedAtSign)) -
           speedAtSign) /
          acceleration;
    }
    cout << fixed << setprecision(10) << ans << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run();
}
