$<.each do |line|
  stack = line.chomp.split
  #逆ポーランド記法
  n = []
  stack.each do |x|
    n << (x =~ /\d/ ? x.to_f : eval(n.pop(2).join(x)))
  end
  # inject =>CPU:00.02sec Memory:6164KB
  #n = stack.inject([]) do |s, x|
  #  s << (x =~ /\d/ ? x.to_f : eval(s.pop(2).join(x)))
  #end
  puts sprintf("%.6f", n.first)
end