DIGITS11 - DIGITS COUNT

no tags 

Diana is going to write a list of all positive integers between A and B, inclusive, in base 10 and without any leading zeros. She wants to know how many times each digit is going to be used

Input

Each test case is given in a single line that contains two integers A and B (1 ≤ A ≤ B ≤ 108).

The last test case is followed by a line containing two zeros.

Output

For each test case output a single line with 10 integers representing the number of times each digit is used when writing all integers between A and B, inclusive, in base 10 and without leading zeros. Write the counter for each digit in increasing order from 0 to 9.

Example

Input:
1 9
12 321
5987 6123
12345678 12345679
0 0

Output:
0 1 1 1 1 1 1 1 1 1
61 169 163 83 61 61 61 61 61 61
134 58 28 24 23 36 147 24 27 47
0 2 2 2 2 2 2 2 1 1

hide comments
sarvagya: 2015-07-28 00:50:53

why does this give a WA? <snip>. Are the test cases faulty?

Last edit: 2023-04-28 07:45:13

Added by:MaratónAFDM
Date:2015-07-14
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:MAWK BC C-CLANG NCSHARP CSHARP C++ 4.3.2 CPP CPP14-CLANG COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH JAVA JULIA KTLN NIM OBJC OBJC-CLANG OCT PICO PROLOG PYPY3 R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA