import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int A = scan.nextInt(); int B = scan.nextInt(); int X = scan.nextInt(); int Y = scan.nextInt(); scan.close(); double k1 = (double) Y * A / B; double k2 = (double) X * B / A; double ans = 0; if(X - k1 >= 0) { ans = k1 + Y; }else { ans = k2 + X; } System.out.println(ans); } }