class Yukicoder def initialize n = gets.chomp.to_i w = gets.chomp.split.map(&:to_i).sort sum = w.inject(:+) hash = Hash.new(false) w.each do |num| temp = hash.dup hash.each do |k,v| temp[k+num] = true end hash = temp.dup hash[num] = true end if sum.even? && hash[sum/2] puts "possible" else puts "impossible" end end end Yukicoder.new