#include #include #include #include #include using namespace std; #define rt(x) ((x)*(x)) int xa,ya; int xb,yb; int main(void){ scanf("%d%d%d%d",&xa,&ya,&xb,&yb); if(ya > yb){ swap(xa,xb); swap(ya,yb); } double p = ya+(yb-ya)*(((double)xa/(double)(xa+xb))); printf("%.10f\n",p); //cout << sqrt(rt(xa)+rt(p-ya)) + sqrt(rt(xb)+rt(p-yb)) << endl; }