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:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.