# if require is strictly equal the amount
f = [0] + [inf] * amount
# if require is largest value under amount ceil
f = [0] * (amount + 1)
# ZeroOne Pack: each stuff can only pick one
for i in range(n):
for j in range(amount, weight[i] - 1):
f[j] = max(f[j], f[j - weight[i]] + value[i])
# Complate Pack: each stuff can pick unlimit times
for i in range(n):
for j in range(weight[i], amount + 1):
f[j] = max(f[j], f[j - weight[i]] + value[i])