Bessie was daydreaming one day as she drifted between wakefulness
and that delicious drowsiness that we all feel when we are tired.
For a moment, she counted sheep as couldn't quite sleep. Bessie's
mind is razor sharp and visualizes the numbers as she counts. She
started noticing the digits and wondered: how many instances of
each digit appear in a counting sequence?
Write a program to answer this question. Given two integers M
(1 ≤ M
≤ 2,000,000,000 and N
≤ 500,000), how many of
occurences of each digit appear?
Consider the sequence 129..137: 129, 130, 131, 132, 133, 134, 135, 136,
137. Count the digits to find:
* Line 1: Two space-separated integers: M
* Line 1: Ten space-separated integers that are the counts of the
number of each digit (0..9) that appears while counting
through the sequence.
1 10 2 9 1 1 1 1 0 1
One zero, ten ones, etc.