E. Count The Blocks
time limit per test :2 seconds memory limit per test :256 megabytes
input :standard input output :standard output
You wrote down all integers from 0 to , padding them with leading zeroes so their lengths are exactly n. For example, if n=3 then you wrote out 000, 001, ..., 998, 999.
A block in an integer x is a consecutive segment of equal digits that cannot be extended to the left or to the right.
For example, in the integer 00027734000 there are three blocks of length 1, one block of length 2 and two blocks of le