gets; a = gets.split.map(&:to_r) gets; b = gets.split.map(&:to_r) puts (a.reduce(:/) / b.reverse.reduce(:/)).to_s.gsub('/', ' ')