def gi gets.to_i end def gm gets.split.map(&:to_i) end def gc gets.chomp end def gf gets.to_f end n = gi sum = 0.0 result = [] n.times do x = gi sum += Math.sqrt(x) result << sum end puts result.map { |x| format("%.20f", x) }