package main import . "fmt" import . "sort" func main() { var n,k int Scan(&n,&k) a:=make([]int,n+1) for i:=range a { Scan(&a[i]) } Ints(a) var c int for ;n>0&&k>0;n-- { c++ k-=a[n] } Println(c) }