Fewest Coins — Solution & Editorial
Unbounded-knapsack DP over amounts: dp[v] = 1 + min dp[v−c]. Greedy by largest coin fails for sets like {1, 3, 4} with T = 6.
Complexity: O(N·T)
Watch out: {1,3,4} and T=6: greedy takes 4+1+1 (three coins); DP finds 3+3 (two).