#include using namespace std; int aa[100],bb[100]; int n,m; map,int> dp; int calc(int idx,vector &weight){ if (idx<0) { return 0; } if (idx=0;i--){ if (bb[i]-weight[i]==l) continue; if (weight[i]+aa[idx]<=bb[i]){ vector v=weight; v[i]+=aa[idx]; r = (weight[i]==0) + calc(idx-1,v); if (r> n; for (i=0;i> m; for (i=0;i weight(m+1,0); i=calc(n-1,weight) ; cout <<(i>90?-1:i)<< endl; return 0; }