SP17247 PR003004 - Digit Sum

Description

For a pair of integers a and b, the digit sum of the interval \[a,b\] is defined as the sum of all digits occurring in all numbers between (and including) a and b. For example, the digit sum of \[28, 31\] can be calculated as:

Input Format

On the first line one positive number: the number of test cases, at most 100. After that per test case: - one line with two space-separated integers, a and b (0

Output Format

Per test case: - one line with an integer: the digit sum of \[a,b\];