import java.util.Scanner; public class No236 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); double w1=x*b/a - y; double w2=y*a/b - x; double d; if(w1<0){ d = (double)x*b/a + x; }else if(w2<0){ d = (double)y*a/b + y; }else{ d = x+y; } System.out.printf("%.8f\n", d); } }