#include #include #include using namespace std; int main(void) { //情報入力 int xa; //点aのX座標値 int ya; //点aのY座標値 int xb; //点bのX座標値 int yb; //点bのY座標値 cin >> xa >> ya; cin >> xb >> yb; //点PのY座標値の計算 if (ya > yb) { double yp(yb + (double(ya - yb) * xb) / (xa + xb)); printf("%.7f\n", yp); } else { double yp(ya + (double(yb - ya) * xa) / (xa + xb)); printf("%.7f\n", yp); } int stop; cin >> stop; return 0; }