#include #include using namespace std; int main() { long long int N, L, min,num; cin >> L >> N; vectorW(N); num = 0; for (int i = 0; i> W[i]; } for (int i = 0; i= W[j]){ min = W[j]; W[j] = 10001; } } if (L - min >= 0) { L = L - min; num++; } } cout << num << endl; return 0; }