#include #include using namespace std; int main(void) { int L = 0, N = 0, ans = 0;; int w[10000] = {0}; long sum = 0; cin >> L >> N; for(int i = 0; i < N; i++){ cin >> w[i]; } sort(w, w + N); for(int i = 0; i < N; i++){ sum += w[i]; if(L