gets a = gets.split.map &:to_r b = 1 (a.size-1).times{|i| b *= a[i-1] / a[i] } puts b