Memory limit: 256 MiB
Time limit: 1000 ms
Input file: stdin
Output file: stdout
Problem type: traditional
Judging mode: text compare
$Three$ houses, $three$ floors, $three$ cars, $three$ toilet, $three$ corridors, $three$ doors, $three$ bedrooms, $three$ beds, $three$ pillows...... Bob is a $three$ lover, even his name has $three$ letters!
Alice is a friend of Bob and she wants to give him a number as a present. She knew that Bob likes a odd kind of number, Triple Number.
A Triple Number is formed by concatenating three numbers together. A triple number should not contain the leading zeros. For instance, $123123123$, $333$, $101010$ are Triple Numbers, but $000$, $1010$, $5$, $123$, $010101$ are not.
Alice wonders how many Triple Numbers are there between two positive integers $L$ and $R$ (inclusively). Please help her to find it out.
Each test contains multiple test cases. The first line contains the number of test casesĀ $t$. The description of the test cases follows.
The first line and the only line of each test case contains two positive integers $L$ and $R$.
For each test case, output the number of Triple Numbers lying between $L$ and $R$ (inclusively) in a single line.
For all test data,
$1 \le t \le 100$
$1 \le L \le R \le 10$$12$
Subtask |
Score |
Additional Constraints |
$1$ |
$30$ |
$L = R$ |
$2$ |
$70$ |
No additional constraints |