#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; int main(){ int xa, ya, xb, yb; cin >> xa >> ya >> xb >> yb; double l = min(ya, yb), r = max(ya, yb), ml, mr; rep(i, 100000){ ml = (l * 2 + r) / 3; mr = (l + r * 2) / 3; double L, R; L = hypot(ml - ya, xa) + hypot(ml - yb, xb); R = hypot(mr - ya, xa) + hypot(mr - yb, xb); if(L >= R)l = ml; else r = mr; } cout << setprecision(20) << l << endl; }