#include int main(void){ short L, N, w[10000], i, j, tmp, l, n = 0; scanf("%hd\n%hd\n", &L, &N); l = tmp = L; for(i=0; i= w[i]){ tmp = w[i]; j = i; } } if((l-=tmp) < 0) break; w[j] = tmp = L + 1; n++; } printf("%hd\n", n); return 0; }