#P2567. [SCOI2010] 幸运数字
[SCOI2010] 幸运数字
Description
In China, many people consider and to be lucky numbers. lxhgww thinks so too, so he defines his own "lucky numbers" as those whose decimal representation contains only the digits and . For example, , , and are all "lucky numbers". However, there are too few such "lucky numbers"; for instance, in the interval there are only of them (, , , , , ). Therefore, he further defines "almost lucky numbers": any multiple of a "lucky number" is an "almost lucky number". Of course, any "lucky number" is also an "almost lucky number". For example, , , and are all "almost lucky numbers".
Now lxhgww wants to know how many "almost lucky numbers" there are in a closed interval .
Input Format
The input is a single line containing numbers and .
Output Format
Output a single line containing number, the count of "almost lucky numbers" in the closed interval .
1 10
2
Hint
For of the testdata, it is guaranteed that .
For of the testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号