Special Numbers
시간 제한1.5초메모리 제한2048 MB
k, L, R이 주어질 때 [L, R] 구간에서 각 자릿수의 곱이 k로 나누어떨어지는 수의 개수를 10^9+7로 나눈 나머지를 구한다.
문제
Number theorist Dr. J is attracted by the beauty of numbers. When we are given a natural number of digits and a natural number , is called -special if the product of all the digits of , i.e. is divisible by . Note that the number is always divisible by a natural number.
For example, if and , then the product of all the digits of , is divisible by , so the number is -special. If and , then the product of all the digits of , is not divisible by , so the number is not -special.
Given three natural numbers , , and , write a program to output where is the number of - special numbers among numbers in the range .
입력
Your program is to read from standard input. The input has one line containing three integers, , , and (, ).
출력
Your program is to write to standard output. Print exactly one line. The line should contain where is the number of -special numbers among the numbers in the range , where both and are inclusive in the range.