ll@N,@K,@A[N],x=0; sort(A,A+N); rep[A](a,N){if(K>=a)K-=a,x++;else break;} wt(x,K);