gets a=gets.split.map(&:to_r).reduce :/ gets gets.split.each_with_index{|e,i|a=eval'a%s%s'%['/*'[i%2],e]} puts a.to_s.tr('/',' ')