import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a, b, ra, rb, ca, cb, ans; ra = sc.nextDouble(); rb = sc.nextDouble(); a = sc.nextDouble(); b = sc.nextDouble(); ca = b*ra/rb; cb = a*rb/ra; if(a > ca){ System.out.println(ca+b); } else if(b > cb){ System.out.println(a+cb); } else { System.out.println(a+b); } } }