P13493 [CodeChef] spalnum
入门
题目描述

A number is called palindromic if its decimal representation is a palindrome. You are given a range, described by a pair of integers L and R. Find the sum of all palindromic numbers lying in the range [L, R], inclusive of both the extrema.

Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The first line of each test case contains a pair of space separated integers L and R denoting the range for which you are required to find the sum of the palindromic numbers.

Output
For each test case, output a single line containing the sum of all the palindromic numbers in the given range.

Constraints

1 ≤ T ≤ 100
Example
Input:
2
1 10
123 150

Output:
45
272

Explanation
Example case 1. The palindromic numbers between 1 and 10 are all numbers except the number 10. Their sum is 45.
Example case 2. The palindromic numbers between 123 and 150 are 131 and 141 and their sum is 272.

输入格式

见题面

输出格式

见题面

样例输入
2 1 10 123 150
样例输出
45 272