UVa 1225

For each test case, a set of integers from 1 to N are concatenated, and the frequency count of each digit is required.

Explanation
Solved by dynamic programming. Each frequency count is simply an increase of digits on the left.

Gotchas

 * Any points one can easily overlook?
 * The correct way to understand ambiguous formulations?

Implementations
Notes/Hints on actual implementation here.

Optimizations
Optimizations here.

Input
2 3 13

Output
0 1 1 1 0 0 0 0 0 0 1 6 2 2 1 1 1 1 1 1