#include #include void bubble_sort(int *data, int n){ int i,x; bool flag = false; while(flag == false){ flag = true; for(i=0; i data[i+1]){ x = data[i]; data[i] = data[i+1]; data[i+1] = x; flag = false; } } } } int main(void){ int L,N,i,sum; int *Wi; scanf("%d",&L); scanf("%d",&N); Wi = (int*)malloc(N*sizeof(int)); for(i=0; i L) i--; } while (++i <= N && sum <= L); printf("%d",i); /* for(i=0,sum=0; i