#P1554. Counting Digits

    ID: 14840 Type: Default 1000ms 256MiB

Counting Digits

Counting Digits

Bessie’s mind is as sharp as ever, as if she could see each number she counted in vivid detail. In this problem, you are given two integers \(M\) and \(N\). Bessie starts counting from \(M\) to \(N\) (inclusive) and takes note of every digit from \(0\) to \(9\) that appears in each number. Your task is to determine how many times each digit appears in the sequence.

Formally, given two integers \(M\) and \(N\), count the frequency of each digit in the sequence:

[ [M, M+1, M+2, \ldots, N-1, N] ]

For each digit from \(0\) to \(9\), output its count.

inputFormat

The input consists of a single line containing two integers \(M\) and \(N\) separated by a space.

\(1 \leq M \leq N \leq 10^6\)

outputFormat

Output a single line with 10 integers. The \(i^{th}\) integer (0-indexed) corresponds to the number of times digit \(i\) appears in the numbers from \(M\) to \(N\) (inclusive). Separate the numbers with a space.

sample

1 10
1 2 1 1 1 1 1 1 1 1