N, W = gets.split(" ").map{|s| s.to_i} a = gets.split(" ").map{|s| s.to_i} w0 = [[0, []]] print w0[1], "\n" 0.upto(N-1) {|i| w1 = [] w0.each {|w, v| w1 << [w, v] tmp = [w + a[i] / 2, v + [i]] w1 << tmp if tmp[0] <= W tmp = [w + a[i], v + [i]] w1 << tmp if tmp[0] <= W } w0 = w1 } puts w0.filter{|x, y| x == W}.map{|x, y| y}.uniq.length