"Woooooo"
A function is defined as follows :
Here x \oplus y denotes the bitwise XOR operation of integers and .
You're given four integers , , , . Your task is to evaluate the sum of function values for each integer from to (inclusive).
More formally,
The first line contains a single integer (1 \le t \le 10^4) – the number of test cases.
The only line of each test case contains four integers , , , (1 \le a,b \le 10^9) (1 \le l \le r \le 10^9).
For each test case , output the required sum.
Please note ! that the answer for some test cases won't fit into 32-bit integer type, so you should use at least 64-bit integer type in your programming language (like long long for C++).
It can be shown that the answer for each test case doesn't exceed 2 \cdot 10^{18}
Example 1
In the first test case, f(4)+f(5)+f(6)=1+3+2=6.
In the third test case, f(33)+f(34)=112+100=212.
In the fourth test case, f(3)+f(4)+f(5)=8+10+2=20
Subtask ( points): (a=b=l=r)
Subtask ( points) : (l=r)
Subtask ( points) : (a=b)
Subtask ( points) : (1 \le \sum r-l+1 \le 5 \cdot 10^5)
Subtask ( points) : (1 \le a,b,l,r \le 10^4)
Subtask ( points) : No additional constraints.