UVa 11137 - Ingenuous Cubrency

11137 - Ingenuous Cubrency
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2078

Summary
You are given coins of cubic values (1,8,27,..), count how many ways you can form the sum N.

Explanation
Generate All the coins values, run DP Knapsack algorithm of either leaving the current coin or taking it (can get the same coin multiple times).

Gotchas
Use long long

Input
10 21 77 9999

Output
2 3 22 440022018293