DIGCNT - digit count
Given two integers a and b, we write the numbers between a and b, inclusive, in a list. Your task is to calculate the number of occurrences of each digit except zero.
For example, if a = 1024 and b = 1032, the list will be 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032. There are ten 1s, seven 2s, three 3s, etc.Input
The input consists of up to 500 lines. Each line contains two numbers a and b, where 1 <= a, b <= 10^16. The input terminates when a is 0.
Output
For each pair of input, output a line containing ten numbers separated by single spaces. The first number is the number of occurrences of the digit 1, the second is the number of occurrences of the digit 2, etc.Example
input 1 10 0 0 output 2 1 1 1 1 1 1 1 1
Added by: | abdou_93 |
Date: | 2013-05-08 |
Time limit: | 1s |
Source limit: | 290B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | another version of http://www.spoj.com/problems/MDIGITS/ |