const int MAX=1;
int v;
int f[MAX];inline void zoPack(int cost,int weight)//cost 为费用, weight 为价值
{for(int i=v;i>=cost;i--) if(f[i-cost]+weight>f[i]) f[i] = f[i-cost] + weight;
}
inline void compPack(int cost,int weight)
{for(int i=cost;i<=v;i++) if(f[i-cost]+weight>f[i]) f[i] = f[i-cost] + weight;
}
inline void mtpPack(int cost ,int weight,int amount)
{if(cost*amount >= v) compPack(cost,weight);else{for(int k=1;k<amount;){zoPack(k*cost,k*weight);amount -= k;k <<= 1;} zoPack(amount*cost,amount*weight);}
}inline void grpPack(int * cost, int * weight, int amount)
{for(int i=v;i;i--) for(int j=1;j<=amount;++j)if(i >= cost[j]) dp[i] = max(dp[i], dp[i-cost[j]] + weight[j] )}
//分组背包,组内至少选一个(可多选) 则组内做01背包,先物品后状态(二维记录)
// 至多选一个 则组内先状态后物品(1维即可)
// 多维多状态转移 需要注意方程顺序 ps: cost = 0;