begin ns = gets.chomp if ns.include?(' ') ab = ns.split.map(&:to_i).inject(:+) s = gets.chomp puts "#{ab} #{s}" exit end N = ns.to_i lines = readlines if lines.size == 0 puts N*(N+1)/2 elsif lines.size == 1 puts lines[0].split.map(&:to_i).inject(:+) else puts lines.map(&:to_i).inject(:+) end rescue puts "Hello World!" end