logo AlgoBeat OnlineJudge
登录 注册

#214239. [ICPC 2023 Seoul R] Special Numbers

内存限制:2048 MiB 时间限制:1500 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

样例

样例输入 1

5 1 20

样例输出 1

4

样例输入 2

5 50 100

样例输出 2

19

样例输入 3

15 11 19

样例输出 3

0