ARRANGE2 - Rearranging Digits
Given A and B, how many numbers between A and B (with no leading 0's) rearrange their digits when multiplied by 2 ?
The first line contains the number of test cases T. T lines follow, containing two integers A and B.
Output T lines, one for each test case containing the desired answer for the corresponding test case.
Sample Input :
Sample Output :
1 <= T <= 10000
1 <= A <= B <= 10000000000 (10^10)