/* is a multi-backpack problem, in fact, I still do not understand the backpack, but with the dynamic equation of memory can be played can be AC code, but also strange */#include <iostream>//00451533 2010-07-10 18:40:39 Accepted 1005 412 KB Visual C + + regrets Sheng #include <cstdio> #include <cstring> using namespace std; const int N = 60005; int main () {int kind[7]; int t = 1; while (1) {int sum = 0; int val = 0; for (int i = 1; I <= 6; i++) {scanf ("%d", &am P;kind[i]); Kind[i]%= 10;//This sentence did not add on the tle val + = i * kind[i]; Sum + = Kind[i]; } if (sum = = 0) break; if (VAL/2! = VAL-VAL/2) {printf ("Collection #%d:/n", t++); printf ("Can ' t be divided./n/n"); continue;} int dp[n]; memset (DP, 0, sizeof (DP)); for (int i = 1, i <= 6; i++) for (int j = 1; J <= Kind[i]; j + +) for (int k = VAL/2; k >= i; k--) dp[k] = max (dp[k) , Dp[k-i] + i); if (dp[val/2] = = VAL-VAL/2) {printf ("Collection #%d:/n", t++), printf ("Can be divided./n/n"),} else {printf ("Colle Ction #%d:/n ", t++); printf ("Can ' t be divided./n/n"); } } }