import java.util.Scanner; public class No236 { 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(); if(X/A < Y/B) { System.out.println(X * (A+B) / A); }else if(X/A > Y/B){ System.out.println(Y * (A+B) / B); }else { System.out.println(X + Y); } } }