#P6400. [COI 2008] UMNOZAK
[COI 2008] UMNOZAK
Description
Define the digit product of a positive integer as the result of multiplying all of its digits. For example:
The digit product of is: .
Define the self-product of a positive integer as the result of multiplying the number by its digit product. For example:
The self-product of is: .
Given two integers , find the number of positive integers whose self-product lies in the interval .
Input Format
Input one line containing two integers .
Output Format
Output one line containing one integer, indicating how many positive integers have their self-product within the interval .
20 30
2
145 192
4
2224222 2224222
1
Hint
Explanation for Sample 2
There are that satisfy the requirement. Their self-products are , respectively.
Constraints
- For of the testdata, ;
- For another of the testdata, ;
- For of the testdata, .
Notes
This problem is translated from COCI2007-2008 COI2008 T4 UMNOZAK。
Translated by ChatGPT 5
京公网安备 11011102002149号