#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, v;
  int l, d, w;
  cin >> a >> v >> l >> d >> w;
  if (2 * a * d <= w * w || v <= w) {
    if (v * v / double(2 * a) > l)
      printf("%.10lf\n", sqrt(2 * l / double(a)));
    else
      printf("%.10lf\n",
             v / double(a) + (l - v * v / double(2 * a)) / double(v));
  } else {
    double t2;
    if ((v - w) * (v + w) / double(2 * a) > l - d) {
      t2 = (-2 * w + sqrt(4 * w * w + 8 * a * (l - d))) / double(2 * a);
    } else
      t2 = (v - w) / double(a) +
           (l - d - (v - w) * (v + w) / double(2 * a)) / double(v);
    double s1 = w * w / double(2 * a);
    double s2 = (d - s1) / 2.0;
    if (s1 + s2 > v * v / double(2 * a)) {
      double ss = d - s1 - 2 * ((v - w) * (v + w) / double(2 * a));
      printf("%.10lf\n",
             w / double(a) + 2.0 * (v - w) / double(a) + ss / double(v) + t2);
    } else {
      printf("%.10lf\n",
             w / double(a) +
                 2.0 * (-2 * w + sqrt(4 * w * w + 8 * a * s2)) / double(2 * a) +
                 t2);
    }
  }
  return 0;
}
