class Yukicoder def initialize x1, y1 = gets.chomp.split.map(&:to_i) x2, y2 = gets.chomp.split.map(&:to_i) if y1 > y2 a = x1 + x2 b = y1 - y2 puts (y1 - Rational(b, a) * x1).to_f else a = x1 + x2 b = y2 - y1 puts (y2 - Rational(b, a) * x2).to_f end end end Yukicoder.new