logo AlgoBeat OnlineJudge
登录 注册

#214161. [SDCPC 2019] Happy Equation

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Little Sub has just received an equation, which is shown below, as his birthday gift. Given the value of , please help Little Sub count the number of () which satisfies the equation.

输入格式

There are multiple test cases. The first line of the input contains an integer (about ), indicating the number of test cases. For each test case:

The first and only line contains two integers and (, ).

输出格式

For each test case output one line containing one integer, indicating the answer.

样例

样例输入 1

2
6 12
8 16

样例输出 1

1023
16383