#include <bits/stdc++.h>
int main(void) {
  double a, v, l, d, w, answer = 0;
  scanf("%lf %lf %lf %lf %lf", &a, &v, &l, &d, &w);
  if (v < w) {
    if (v * v > 2 * a * l)
      answer = sqrt(2 * l / a);
    else
      answer = v / a + (l - (v * v) / (2 * a)) / v;
  } else {
    l -= d;
    if (a * sqrt(2 * d / a) <= w)
      answer = sqrt(2 * d / a), w = sqrt(2 * a * d);
    else {
      double vv = sqrt((2 * a * d + w * w) / 2);
      if (vv > v)
        answer += v / a + (v - w) / a + (d - (2 * v * v - w * w) / (2 * a)) / v;
      else
        answer += vv / a + (vv - w) / a;
    }
    if (v * v - w * w > 2 * a * l)
      answer += (sqrt(2 * a * l + w * w) - w) / a;
    else
      answer += (v - w) / a + (l - (v * v - w * w) / (2 * a)) / v;
  }
  printf("%.10lf\n", answer);
  return false;
}
