P18657 [HackerEarth] Bob likes DSD Numbers.DSD Number is a number which is divisible by its Digit Sum in Decimal Representation.
普及
题目描述

Bob likes DSD Numbers.DSD Number is a number which is divisible by its Digit Sum in Decimal Representation.

digitSum(n) : Sum of digits of n (in Decimal Representation)

eg: n = 1234 then digitSum(n) = 1 + 2 + 3 + 4 = 10

DSD Number is number n such that n % digitSum(n) equal to 0

Bob asked Alice to tell the number of DSD Numbers in range [L,R] inclusive. Alice does not know the answer,So she asked her Coder friend i.e you for the help. Help Her !!

Constraints:

1 ≤ test cases ≤ 50

1 ≤ L ≤ R ≤ 10^9

SAMPLE INPUT
4
2 5
1 10
20 45
1 100

SAMPLE OUTPUT
4
10
9
33

输入格式

见题面

输出格式

见题面

样例输入
50 18467 186403 26500 25970564 15724 78531948 29358 47043246 24464 110460816 28145 23395825 16827 95375803 491 40800747 11942 12279462 5436 19776828 14604 132688140 153 15982745 12382 1208414 18716 71375132 19895 80784823 21726 22332638 11538 60513554 19912 7675336 26299 105158331 9894 69785254 23811 117591299 30333 128325245 4664 72393272 7711 62025247 6868 115731156 27644 104668156 32757 133816309 12859 82084411 9741 35739149 778 112759562 3035 50449371 1842 90892082 30106 1209754 8942 37036782 22648 78927992 23805 112442621 6729 65092169 15350 99834870 31101 61495677 3548 99917276 12623 80413007 19954 98668018 11840 76836416 7376 20348112 26308 57087684 32439 69435063 11323 100879419 21538 22701090 2082 66021410 16541 93933725
样例输出
2627 1115510 505232 1030809 976915 28345 230497 630598 16908 777184 256128 509224 1079972 442898 1303053 223876 1186694 1160444 833087 436470 541688 89249 410537 950981 675378 653772 1028301 552735 779930 339374 712865 501388 684683 699813 221886 445601 1318793 1204610 293519 662519 1010434 773959 995149 530220 713753 164762 752507 539915 640400 436930