#P11557. Count Interesting Numbers

    ID: 13647 Type: Default 1000ms 256MiB

Count Interesting Numbers

Count Interesting Numbers

A number is defined as interesting if its digits, when written in base-10, are in non-decreasing order. In other words, a number with digits (d_1 d_2 \ldots d_k) is interesting if (d_1 \le d_2 \le \cdots \le d_k). For example, (1145), (2333), and (1377777) are interesting numbers.

Given two integers (L) and (R), count how many interesting numbers exist in the interval ([L, R]) (inclusive), and output the result modulo (10^9+7).

inputFormat

The first and only line of input contains two integers (L) and (R) separated by a space.

outputFormat

Output a single integer – the count of interesting numbers in ([L, R]) modulo (10^9+7).

sample

1 10
9