import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double A = sc.nextDouble(); double B = sc.nextDouble(); double X = sc.nextDouble(); double Y = sc.nextDouble(); double ans = 0; if(X * B <= A * Y) ans = (X * (A + B)) / A; if(X * B >= A * Y) ans = Math.max(ans, (Y * (A + B)) / B); System.out.println(ans); } }