Time Limit: 1000 MS Memory Limit: 65536 K
we define a function f( x ) = the number of 1 in the binary sequene of (x ^ x + 1).
now I want to know the value of f(a) + f(a + 1 ) + ... + f(b). can you tell me ?
The first line of input is the number of test case.
For each test case, there is one lines contains two numbers a, b ( 0 <= a <= b <= 10^9 ).
For each test case output the answer on a single line,
Sichuan University Programming Contest 2012 Final