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 contains 2 integer 'from' and 'to'. These indicate the range of Zip codes where Raone might attack. ('From' and 'to' are included in the range)
NOTE:'t' will be less than 100. 'from' and 'to' will be between 0 and 10^8 inclusive.
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
hide comments
caubecuto:
20230823 10:49:45
are there anyone has dp digit tutorial document? pls give me . thank


buitung1309:
20211102 16:09:18
Note: Indexing starting from 1, from right to left.


shivangini_19:
20210710 06:48:11
My 100th;) use long int indexing starts from right to left 1 based! 

ttv_ankush:
20210425 11:31:48
What are the constraints for this problem?


jpgmoreira:
20200725 01:56:05
Indexing starting from 1, from right to left. 

horro:
20200629 20:29:15
Indexing from right to left, don't use long long (getting tle) !! Nice digit dp problem 

Shubham Jadhav:
20200628 17:34:26
Nice Problem 

hrithik_sh10:
20200603 20:26:01
ac in two go Last edit: 20200603 20:26:32 

zxcv_1:
20200318 16:47:09
Worst problem statement . Why didnt they mention order of indexing ? 

abhimanyu_1998:
20191214 21:02:02
Cakewalk 
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 