UVa 344 - Roman Digititis

344 - Roman Digititis

 * http://acm.uva.es/p/v3/344.html

Summary
Figure out the number of i,v,x,l,c in a book with n pages

Explanation

 * For each number from 1 to n figure out how many i,v,x,l,c are in a book of size n.
 * Just keep track of it in an array or something and output it in the end.

Input
1 2 20 99 0

Output
1: 1 i, 0 v, 0 x, 0 l, 0 c 2: 3 i, 0 v, 0 x, 0 l, 0 c 20: 28 i, 10 v, 14 x, 0 l, 0 c 99: 140 i, 50 v, 150 x, 50 l, 10 c

Solution

 * http://acm-solution.blogspot.com/2010/10/acm-uva-344-roman-digititis.html