@n = gets.strip.to_i @w = gets.strip.split(' ').map(&:to_i) @total = @w.inject(:+) @w.sort def dfs(i, sum) if sum * 2 == @total puts "possible" exit end if i >= @n || sum * 2 > @total return end dfs(i + 1, sum) dfs(i + 1, sum + @w[i]) end dfs(1, @w[0]) puts "impossible"