XOR
题号:NC25731
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

    Exclusive or is a logical operation that outputs true only when inputs differ(one is true, the other is false). It is symbolized by the infix operators such as XOR, .
    This time, brave QQQ raises a problem to you. Given an interval [l, r], you need to calculate how many numbers x between l and r, where x satisfies .

输入描述:

    The first line contains an integer number T, the number of test cases.
     of each next T lines contains two integers l, r().

输出描述:

For each test case print the answer.
示例1

输入

复制
2
2 6
1 109

输出

复制
4
39