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