#C8565. Count Palindromic Numbers in a Range
Count Palindromic Numbers in a Range
Count Palindromic Numbers in a Range
In this problem, you are given a range of integers \([L, R]\). Your task is to determine the number of palindromic numbers and non-palindromic numbers within this range. A number is called a palindrome if it reads the same forward and backward. For example, \(121\) is a palindrome while \(123\) is not.
For each test case, output two space-separated integers: the first representing the count of palindromic numbers and the second representing the count of non-palindromic numbers in the specified range.
inputFormat
The input begins with a single integer T
denoting the number of test cases. Each of the following T
lines contains two integers L
and R
(with \(L \le R\)) separated by a space.
outputFormat
For each test case, output a single line containing two space-separated integers: the first is the count of palindromic numbers in the range \([L, R]\), and the second is the count of non-palindromic numbers.
## sample3
1 10
11 20
21 30
9 1
1 9
1 9
</p>