#include using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--) #define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((ll)(x).size()) #define len(x) ((ll)(x).length()) #define endl "\n" ll xa, ya, xb, yb; long double f(long double v) { long double dx1 = abs(xa - 0); long double dy1 = abs(ya - v); long double dx2 = abs(xb - 0); long double dy2 = abs(yb - v); return sqrt(dx1 * dx1 + dy1 * dy1) + sqrt(dx2 * dx2 + dy2 * dy2); } int main() { cin.tie(0); ios::sync_with_stdio(false); // ifstream in("input.txt"); // cin.rdbuf(in.rdbuf()); cin >> xa >> ya >> xb >> yb; long double low = 0, high = 2000; rep(i, 100) { long double lmid = (low * 2 + high) / 3; long double hmid = (low + high * 2) / 3; if (f(lmid) > f(hmid)) { low = lmid; } else { high = hmid; } } printf("%.10Lf\n", low); return 0; }