require 'bigdecimal' s = BigDecimal(0) $<.drop(1).each{|a| s += BigDecimal(a) } ans = s.to_s("F") ans += '000000000000000' cnt = -1 ans.each_char{|c| print c if cnt >= 0 then cnt += 1 break if cnt == 10 end cnt = 0 if c == '.' } puts