#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU A, B, X, Y = gets.chomp.split.map(&:to_f) case (A / B) <=> (X / Y) when 0 puts (X + Y) when 1 Ya = B * X / A puts (X + Ya) when -1 Xb = A * Y / B puts (Xb + Y) end