xa,ya = gets.split.map(&:to_f) xb,yb = gets.split.map(&:to_f) a=(yb-+ya)/(xa+xb) puts ya+xa*a