#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, v, l, d, w, v0;
  double time1, time2, time3, time4, total;
  cin >> a >> v >> l >> d >> w;
  if (w >= v) {
    if ((v * v / (2.0 * a)) <= l) {
      time1 = v / a, time2 = (l - (v * v / (2.0 * a))) / v;
      total = time1 + time2;
    } else
      total = sqrt(2.0 * l / a);
  }
  if ((v * v - (w * w)) / (2.0 * a) >= l - d)
    time4 = (-w + sqrt(w * w - (2 * a * (d - l)))) / a;
  else
    time4 = (v - w) / a + ((l - d - ((v * v - w * w) / (2.0 * a)))) / v;
  if (w < v && v * v < 2.0 * a * d) {
    if ((v * v + (v * v) - (w * w)) / (2.0 * a) < d) {
      time1 = v / a;
      time2 = (v - w) / a;
      time3 = (d - ((2 * v * v - (w * w)) / (2.0 * a))) / v;
      total = time1 + time2 + time3 + time4;
    } else {
      v0 = sqrt(w * w / 2.0 + (a * d));
      total = v0 / a + (v0 - w) / a + time4;
    }
  }
  if (w < v && v * v >= 2.0 * a * d) {
    if (w * w / (2.0 * a) >= d) {
      if ((v * v / (2.0 * a)) <= l) {
        time1 = v / a, time2 = (l - (v * v / (2.0 * a))) / v;
        total = time1 + time2;
      } else
        total = sqrt(2.0 * l / a);
    } else {
      v0 = sqrt(w * w / 2.0 + (a * d));
      total = v0 / a + (v0 - w) / a + time4;
    }
  }
  printf("%.7f", total);
  return 0;
}
