#include using namespace std; int main() { int i; int A; int B; int X; int Y; cin >> A; cin >> B; cin >> X; cin >> Y; i = A * Y - B * X; if( i > 0 ) cout << (long double) ( B * X ) / A + X << endl; else if( i < 0 ) cout << (long double) ( A * Y ) / B + Y << endl; else cout << "Err" << endl; return 0; }