#include using namespace std; #define int long long #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif signed main(){ int a,b,c,d; cin >> a >> b >> c >> d; auto f = [&](long double t){ //int res = sqrt(pow(a,2) + pow(b-t,2)) + sqrt(pow(c,2) + pow(d-t,2)); long double res = sqrt(a*a + (b-t)*(b-t)) + sqrt(c*c + (d-t)*(d-t)); return res; }; long double left = min(b,d),right = max(b,d); //[left , t1 , t2 , right] while(right - left > 1e-9){ long double t1 = (left * 2 + right) / 3.0; long double t2 = (left + right * 2) / 3.0; if(f(t1) > f(t2)) left = t1; else right = t2; cout << left << " " << right << endl; } printf("%.6f\n",(double)right); return 0; }