#include int main(void){ int l,n; int w[10000]; int count=0,count2; int nowwidth,nowminimum,nowminimumcount; scanf("%d",&l); scanf("%d",&n); nowwidth=l; nowminimum=99999999; nowminimumcount=99999999; for(count=0;count=nowminimum){ nowminimum=w[count]; nowminimumcount=count; } } if(l<=0){break;} l=l-nowminimum; count2++; w[nowminimumcount]=99999999; if(l<=0){break;} } printf("%d\n",count2); }