CNT_LUCK  Counting Lucky Numbers
Find out how many numbers between a and b (inclusive) when represented as binary numbers have sum of digits lucky.
A number is lucky if it's decimal representation contains digits 4 and 7 only.
eg. 4, 7, 47 , 77 etc. where as 14 , 41 etc. are not.
Note that 0 <= a <= b <= 10^19.
Input
T: no of test cases T<=10^5
Next T lines have a and b in every line. a <= b
Output
for every test case output as described in problem statement
Example
Input: 2
15 15
63 63 Output: 1
0
hide comments
shubhamgoyal__:
20160622 07:56:36
Take care of the case when a=b=0.Answer must be 0. 

Medo:
20150824 12:42:49
I passed a 10000 random generated test cases against an AC code however I keep getting a WA...


P_Quantum:
20140228 17:53:29
nice prblm :) 

Xsquare:
20130701 12:08:05
Last edit: 20130701 17:57:24 

Utsav Sinha:
20130628 18:05:22
Point to be Noted : "44" is a lucky number. Got WA due to it :(


edoc:
20130623 09:09:17
@pravin123 can we take input in c++ as unsigned long long.. or we are to use string?? 

Kartik Khare:
20130607 05:16:07
I am pretty much sure i have the correct solution but still not getting AC..


nitish rao:
20130519 08:44:01
Last edit: 20130519 08:45:23 

Problem Solver:
20130222 10:00:20
Please help with that :) If you can, mail me knifemod at gmail or just give some test case here... Would greatly appreciate. thanks. 

Problem Solver:
20130222 10:00:20
Thanks for an answer, but i still cant understand what could i misunderstood in contraits. Valuesfit in unsigned long long and are positive. Could you help me with that or point what am doing wrong? Thanks in advance... 
Added by:  praveen123 
Date:  20130121 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  general 