The Palindromic Conjecture
All submissions for this problem are available.
Sheldon, Howard, Raj, Leonard and Penny were eating dinner. Suddenly, Sheldon said, "I don't like this food. Look at the shape of pizza it's looking like on one side there is flood of cheese and sauce whereas on other side there is drought. Now how can we properly divide it among ourselves. It should be mirror image". Then suddenly Raj said, "Just like palindromes, do you know Barry is working on palindromes. And he is now trying to find the sum of palindromes between two numbers". This made Sheldon feel embarrassed and wants your help to make a program find the sum of palindromes between any given two numbers, But due to his arrogance he will not ask you directly. So on behalf of Sheldon we want you to help him.
First line contains the of test cases 'T'.
Then 'T' lines follow each containing two integers 'A' and 'B'.
'T' lines corresponding to each test case which contain the sum of palindromes between 'A' and 'B', inclusive 'A' and 'B'. The answer must be given modulo 10000007.
T <= 100
0 <= A <= B <= 10^(100000)
Input: 2 4 21 10 12 Output: 50 11
|Time Limit:||0.441589 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.