P10959 The Mystery of the Moon.
Description
If a decimal number can be divided by the sum of its digits, then this number is called a "Moon number".
Given integers $L$ and $R$, you need to compute how many "Moon numbers" there are in the closed interval $[L, R]$.
Input Format
Multiple sets of testdata. Each set is on one line and contains two integers $L$ and $R$.
Output Format
For each set of data, output one integer per line, representing the number of Moon numbers.
Explanation/Hint
Constraints: It is guaranteed that $1 \le L, R < 2^{31}$, and there are no more than $3000$ testdata sets in a single test.
Translated by ChatGPT 5