#include #include using namespace std; int main(){ long int l,n; vector w(n); cin>>l>>n; for(int i=0;i>w[i]; } int count=0; while(1){ int min=l; int itr; for(int i=0;iw[i]){ min=w[i]; itr=i; } } l=l-min; w.erase(w.begin()+itr); if(l<0)break; if(w.size()<=0)break; count++; } cout<