#include using namespace std; int main(){ int l,n; cin >> l >> n; vector w(n); for(int i=0;i> w[i]; } if(accumulate(w.begin(),w.end(),0)<=l){ cout << n << endl; return 0; } sort(w.begin(),w.end()); int ans =0; int last; while(ans