#include #define REP(i,n) for(int i=0;i>l>>n; vector w(n); REP(i,n)cin>>w[i]; sort(ALL(w)); int ans=0; REP(i,n){ if(l-w[i]>0){ ans++; l-=w[i]; } } cout<