JZPEXT - Beautiful numbers EXTREME

题意翻译

### 题目描述 我们定义“美丽的数”:当且仅当它可以被它的每个非零数位上的数整除。给定一个区间[l,r],请计算有多少个美丽的数字n满足l<=n<=r。 ### 输入格式 先输入t t行,每行两个数字l,r,代表查询间隔[l,r] ### 输出格式 t行,第t行是第t个查询的答案。

题目描述

We call one integer beautiful, if and only if it is divisible by each of its non-zero digits. Given an interval \[l, r\], calculate how many beautiful numbers n satisfy l<=n<=r.

输入输出格式

输入格式


Then t lines follow, each line two numbers l, r, representing the query interval \[l, r\]

输出格式


t lines. The t-th line is the answer to the t-th query.

输入输出样例

输入样例 #1

1
1 100

输出样例 #1

33