RAONE  RaOne Numbers
In the War between good and evil . RaOne is on the evil side and GOne on the good side.
RaOne is fond of destroying cities and its Gone's duty to protect them..
RaOne loves to destroy cities whose Zip Code has special properties. He says he loves to destroy cities which have RaOne numbers as their ZIp Code.
Any number is Raone if the Difference between Sum of digits at even location and Sum of digits at odd location is One (1).. For eg... for 234563 is RaOne number
digits at odd location are 3,5,3 (unit place is location 1 )
digits at even location are 2,4,6
Diff = (2+4+6)(3+5+3)=1211 = 1.
And 123456 is not RaOne number
diff = (5+3+1)  (2+4+6) = 4
GOne knows this about Raone and wants to deploy his Army members in those cities. 1 army member will be deployed in each city.
Gone knows the range of ZIPCodes where RaOne might attack & needs your help to find out how many army members he needs.
Can you help Him ?
Input
first line will have only one integer 't' number of ZipCode ranges. it is followed by t lines
each line from 2nd line cotains 2 integer 'from' and 'to'. these indicate the range of Zip codes where Raone might attack .(from and to are included in the range)
Output
A single number for each test case telling how many army members GOne needs to deploy.
each number should be on separate lines
Example
Input: 2
1 10
10 100
Output:
1
9
explanation:
for 1st test case the only number is 10
for 2nd test case numbers are 10,21,32,43,54,65,76,87,98
NOTE: t will be less than 100
from and to will be between 0 and 10^8 inclusive
hide comments
cichipi_:
20181210 12:07:57
Stupid problem statement...


playingitmyway:
20180912 22:37:03
AC in one go! Nice digit dp problem :) Last edit: 20180912 22:37:33 

sxie12:
20180212 08:19:45
Be careful. From and to are between 0 and 10^8 inclusive so it can be 0. That caused my WAs. 

rajatgupta20:
20180208 09:04:35
wasted time in figuring out from where the indexing starts , poor explanation given ! 

Akshay Aradhya:
20180204 13:34:17
Just to clarify Difference here is not the absolute difference 

Reayz:
20180126 15:41:36
It take a lot of time to understand that index is counting from last digit...:( 

vasiljko2001:
20171125 12:02:45
Why 100 is not counted? 

pratham_1:
20171018 12:07:54
YEAHHH!!!!! I solved it in java , I deserve some prize;) Strict time limit... spent almost 34weeks;) 

pratham_1:
20170909 07:34:04
@sucide i used the same approach dp[index][esumosum][fix] but getting timeout;( 

sucide:
20170612 02:53:40
ac in one go ,,, just keep it simple (dp[idx][sumesumo][fix]) 
Added by:  Devil D 
Date:  20120221 
Time limit:  0.101s 
Source limit:  30000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Own 