import java.util.Scanner; public class Main{ public static void main(String... args){ Scanner scan = new Scanner(System.in); System.out.println(calc(scan)); } public static double calc(Scanner scan){ double xa = scan.nextDouble(); double ya = scan.nextDouble(); double xb = scan.nextDouble(); double yb = scan.nextDouble(); if(ya == yb) return ya; if(xa == 0 && xb == 0) return (ya+yb)/2.0; return yb-(yb-ya)/(xb+xa)*xb; } }