SP11180 NUMTSN - 369 Numbers
Description
**7. 369 numbers**
A number is said to be a 369 number if
1. The count of 3s is equal to count of 6s and the count of 6s is equal to count of 9s.
2. The count of 3s is at least 1.
For Example 12369, 383676989, 396 all are 369 numbers whereas 213, 342143, 111 are not.
Given A and B find how many 369 numbers are there in the interval \[A, B\]. Print the answer modulo 1000000007.
**Input**
The first line contains the number of test cases (T) followed by T lines each containing 2 integers A and B.
**Output**
For each test case output the number of 369 numbers between A and B inclusive.
**Constraints**
T
Input Format
N/A
Output Format
N/A