#P9092. [PA 2020] Liczba Potyczkowa
[PA 2020] Liczba Potyczkowa
Problem Description
This problem is translated from PA 2020 Trial Round Liczba Potyczkowa.
In a history of mathematics class, Bajtek learned about a Russian mathematician, Vladimir Potyczkow. This scientist is famous for studying numbers. To honor him, today we call such numbers Potyczkow numbers: they are positive integers and are divisible by every digit that appears in their decimal representation. In particular, this means that their decimal representation cannot contain . For example, , , and are Potyczkow numbers, while , , and are not. Bajtek wants to know how many such numbers are in the range . Please help him count them.
Input Format
One line contains two positive integers .
Output Format
Output one integer on a single line, representing the number of Potyczkow numbers in the range .
1 100
23
Hint
Explanation for Sample 1
Potyczkow numbers not exceeding are $1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22, 24, 33, 36, 44, 48, 55, 66, 77, 88$ and .
Constraints
This problem uses bundled testdata.
For some subtasks, .
For of the testdata, it is guaranteed that .
Translated by ChatGPT 5