// #includeusing namespace std; // 1<=N<=50 // 1<=M<=100000 // 1<=ai<=1000 const int INF=0x3f3f3f3f; const int max_money=1e5+6; const int kinds=111; int dp[ max_money ]; int types[ kinds ]; int n,m; void form() { int i,j; memset( dp,0x3f,sizeof( dp ) ); dp[0]=0; for( i=0;i



