/* -*- coding: utf-8 -*- * * 236.cc: No.236 鴛鴦茶 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { double a, b, x, y; cin >> a >> b >> x >> y; double x0 = y * a / b; double y0 = x * b / a; double ans = (x < x0) ? x + y0 : x0 + y; printf("%.8lf\n", ans); return 0; }