Beautiful number - MarisaOJ: Marisa Online Judge

Beautiful number

Time limit: 500 ms
Memory limit: 256 MB
A number is considered beautiful if it is divisible by all of its digits. This also means that a beautiful number, in its decimal representation, does not contain the digit $0$. Count the number of beautiful numbers in the range $[L, R]$. ### Input - One line containing two integers $L, R$. ### Output - Print an integer, the count of beautiful numbers. ### Constraints - $1 \le L \le R \le 10^{18}$. ### Example Input: ``` 10 123 ``` Output: ``` 18 ```