#P10959. 月之谜

月之谜

Problem Description

If a decimal number can be divided by the sum of its digits, then this number is called a "Moon number".

Given integers LL and RR, you need to compute how many "Moon numbers" there are in the closed interval [L,R][L, R].

Input Format

Multiple sets of testdata. Each set is on one line and contains two integers LL and RR.

Output Format

For each set of data, output one integer per line, representing the number of Moon numbers.

1 100 

33

Hint

Constraints: It is guaranteed that 1L,R<2311 \le L, R < 2^{31}, and there are no more than 30003000 testdata sets in a single test.

Translated by ChatGPT 5