#include <bits/stdc++.h>
using namespace std;
double a, v, l, d, w;
int main() {
  cin >> a >> v >> l >> d >> w;
  double t = w / a;
  w = min(min(w, v), sqrt(2 * a * d));
  if (2 * a * d + w * w > 2 * v * v)
    t = (d - v * v / a + w * w / a / 2) / v + (2 * v - w) / a;
  else
    t = (2 * sqrt(a * d + w * w / 2) - w) / a;
  l = l - d;
  double t2 = (v - w) / a;
  if (l - w * t2 - 0.5 * a * t2 * t2 > 0)
    t2 = t2 + (l - w * t2 - 0.5 * a * t2 * t2) / v;
  else
    t2 = (-w + sqrt(w * w + 2.0 * a * l)) / a;
  printf("%.12f\n", t + t2);
}
