n,k=gets.split(" ").map{|e| e.to_i} xs=gets.split(" ").map{|e| e.to_i}.sort ans=0 n.times{|i| break if k-xs[i]<0 k-=xs[i] ans=i+1 } puts [ans,k].join(" ")