#include #include #include using namespace std; double xa, ya, xb, yb; double f(double py){ return sqrt(pow(xa - 0, 2) + pow(ya - py, 2)) + sqrt(pow(xb - 0, 2) + pow(yb - py, 2)); } double search(double l, double r,int cnt){ while(cnt--){ if(f((l*2+r)/3)<=f((l+r*2)/3)) r=(l+r*2)/3; else l=(l*2+r)/3; } return (l+r)/2; } int main(){ cin >> xa >> ya; cin >> xb >> yb; printf("%.12f\n",search(0, 1000, 10000000)); }