#include using namespace std; using namespace std::chrono; int main() { int xa, ya, xb, yb; cin >> xa >> ya >> xb >> yb; long double l = 0, r = 1000; auto f = [&](long double mid) { return hypot(xa, ya - mid) + hypot(xb, yb - mid); }; for (int i = 300; i; i--) { long double mid1 = (l * 2 + r) / 3; long double mid2 = (l + r * 2) / 3; (f(mid1) < f(mid2)) ? r = mid2 : l = mid1; } cout << fixed << setprecision(6) << l << "\n"; }