gets n = gets.split.map(&:to_r).inject{|r, n| r / n } gets d = gets.split.reverse.map(&:to_r).inject{|r, n| n / r } puts"#{n / d}".tr ?/, " "