enter code here

```
#include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int l, r, sum = 0;
cin>>l>>r;
for(int i = l; i <= r; i++)
{
int rem;
int temp = 0;
int tempnum = i;
while(i != 0)
{
rem = i % 10;
i = i / 10;
temp = temp*10 + rem;
}
if (tempnum == temp)
sum += temp;
}
cout<<sum<<endl;
sum = 0;
}
return 0;
}
```