import java.util.Scanner; import java.lang.Math; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int ans = 0; int[] C = new int[N]; for(int i=0; ij; k--){ if(C[k] < C[k-1]){ int temp = C[k]; C[k] = C[k-1]; C[k-1] = temp; } } } int l=0; while(M>0){ M -= C[l]; if(M<0){ break; } ans++; l++; } System.out.println(ans); } }