x_a,y_a = gets.split.map(&:to_i) x_b,y_b = gets.split.map(&:to_i) slope = (y_b - y_a) * 1.0 / (x_b + x_a) p y_a + slope * x_a