13019 - Number counting game   

Description

There is a game called "Number counting game", and it has some rules as following:

1. In the begining, set total sum (shared by two players) to zero and construct a number list which countains integers 1 ~ N.

2. Player A and player B should take turns selecting one number from the number list and adding it to the total sum.

3. Each number only can be selected once.

4. If one of the players make the total sum ≥ K, then he is the winner.

Now, given q rounds, you are asked to output whether the first player can win at each round. (Suppose both two players always select the optimal strategy)

For example, if N=3, and K=5:

The optimal strategy for the first player in the first choice is to select 1 instead of 2 and 3, so the fisrt player will select 1 in the begining. 

[HINT]

To solve this problem, you can try to find all number selection order recursively. Once the total sum ≥ K, you should return and store whether the first player can win with current number selection.

Input

First line countains an integer which denotes q. (1 ≤ q ≤ 10)

Then, q lines follow.

Each line contains two integers N, K which denote the max chosen number and the wining target number respectly.

(2 ≤ N ≤ 20, 2 ≤ K ≤ N(N+1)/2)

Output

Output contains q lines and each line contain the answer(True/False) ended with '\n'. 

Sample Input  Download

Sample Output  Download

Tags




Discuss