1 , , , .
, floor(N/5) + 1
[0..N/5] 5 , 1
, /.
, , .
C(x, m):= The # of ways to make number x using first m type of coins
, :
C(x, m) = C(x-coin_type[m], m) + C(x, m-1) , m-
, , .
, -
For i = 0 to
For j = 0 to n
C(j, i) = C(j-coin_type[i], i) + C(j, i-1)
, . coin_type = {1,3,5}, {1}, {1,3}, , {1,3, 5}.
, {3,1,5}, {1,5,3}... .. , , -