#include #include #include #include int compare_int(const void *a, const void *b) { return *(int*)a - *(int*)b; } void CountBlock(int Boxwidth, int Blocknum, int *Blockwidth) { int sum = 0; qsort(Blockwidth, Blocknum, sizeof(int), compare_int); for(int i=0;;i++){ sum += Blockwidth[i]; if ( Boxwidth < sum ){ printf("%d\n",i); break; } } } int main(void) { int Boxlength, Blocknum; scanf("%d",&Boxlength); scanf("%d",&Blocknum); int Blockwidth[Blocknum]; for (int i=0;i