#include <bits/stdc++.h>
using namespace std;
int main() {
  double A, V, L, D, W;
  cin >> A >> V >> L >> D >> W;
  double V1 = sqrt(2 * A * D);
  if (W >= V || V1 <= W) {
    double S = V * V / 2 / A;
    double res;
    if (S <= L) {
      res = V / A + (L - S) / V;
    } else {
      res = sqrt(L / A * 2);
    }
    printf("%.10lf\n", res);
    return 0;
  }
  double res, res2;
  double S = (V * V - W * W) / 2 / A;
  if (S <= L - D) {
    res2 = (V - W) / A + (L - D - S) / V;
  } else {
    res2 = sqrt(W * W - 2 * A * (D - L)) - W;
    res2 /= A;
  }
  double S2 = (2 * V * V - W * W) / 2 / A;
  if (S2 > D) {
    res = sqrt(2 * pow(W / A, 2.0) + 4 * D / A) - W / A;
  } else {
    res = (D - S2) / V + V / A + (V - W) / A;
  }
  printf("%.10lf\n", res + res2);
  return 0;
}
