#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << fixed << setprecision(15); // min sqrt(a^2 + (y - b)^2) + sqrt(c^2 + (y - d)^2) // (a, b) - (-c, d) を結ぶ直線と x = 0 の交点になれば OK // b = at + y, d = -ct + y // b - d = (a + c) t -> t = (b - d) / (a + c) // y = -at + b = (-ab + ad + ab + bc) / (a + c) = (ad + bc) / (a + c) // y = ct + d = (bc - cd + ad + cd) / (a + c) cout << (double) (a * d + b * c) / (a + c) << endl; return 0; }