#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, v, s, d, w, t, temp;
  while (cin >> a >> v >> s >> d >> w) {
    temp = w / a;
    temp = temp * temp * a / 2;
    if (temp > d) {
      temp = 2 * a * s;
      if (temp <= v * v) {
        t = sqrt(temp) / a;
        printf("%llf\n", t);
        continue;
      } else {
        temp = v / a;
        t = temp + (s - v * v / (2 * a)) / v;
        printf("%llf\n", t);
        continue;
      }
    } else {
      if (v > w) {
        double vx = sqrt((w * w + 2 * a * d) / 2);
        if (vx < v) {
          t = (2 * vx - w) / a;
        } else {
          t = v / a;
          t += d / v - v / a + w * w / (2 * a * v);
          t += (v - w) / a;
        }
        if ((2 * a * (s - d) + w * w) <= v * v) {
          temp = 2 * a * (s - d) + w * w;
          t += (sqrt(temp) - w) / a;
          printf("%llf\n", t);
          continue;
        } else {
          temp = (v * v - w * w) / (2 * a);
          t += (v - w) / a;
          t += (s - d - temp) / v;
          printf("%llf\n", t);
          continue;
        }
      } else {
        temp = v / a;
        t = temp + (s - v * v / (2 * a)) / v;
        printf("%llf\n", t);
        continue;
      }
    }
  }
  return 0;
}
