Example v = {10,40,30,50) w = {5,4,6,3} and W = 10
F(i,w) 0 1 2 3 4 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 10 10 10 10 10 10
2 0
3 0 This is clear, as the rows for 0 are 0
4 0 and the row for 1 is only 10 when the weight is 5 or more
F(i,w) 0 1 2 3 4 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 10 10 10 10 10 10
2 0 0 0 0 40 40 40 40 40 50 50 <- take both
3 0 ------------------ since 40+0 ≥ 10+0
4 0
F(i,w) 0 1 2 3 4 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 10 10 10 10 10 10
2 0 0 0 0 40 40 40 40 40 50 50 50 = 40+F(1,9-4)
3 0 0 0 0 40 40 40 40 40 50 70 70 = 30+F(2,10-6)
4 0 0 0 50 50 50 50 90 90 90 90