eval"N,K,*A="+gets(p).split*?, z=0 (0..N).map{|i|A.combination(i){|a|n=a.sum n>z&&n>K||z=n}} p z