Ench Lolz was playing chess, when he accidentally dropped his board on the ground, and everything shattered! All he remembers is that the chessboard was a square, with some number of white and black cells. He goes to the store and buys an $$$n$$$-by-$$$n$$$ grid and $$$k$$$ black tiles. Unfortunately for him, he forgot what a chessboard looks like and is now trying to construct it with the following instructions.
You are given a $$$n$$$-by-$$$n$$$ square, divided into $$$1$$$-by-$$$1$$$ cells. Initially every cell is white. You want to color exactly $$$k$$$ cells black in a way that satisfies the following condition:
Determine if such a coloring is possible. For example, the first square shown here is valid, while the second one is not:
Input consists of multiple tests. The first line contains $$$t$$$, the number of tests ($$$1 \le t \le 1\,000$$$).
The only line of each test contains $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 30\,000$$$).
For each test, print YES if a coloring is possible, and NO otherwise.
43 53 61 3000030000 30000
YES NO NO YES
The first test corresponds to the square shown in the problem statement.
The second test corresponds to the invalid square shown. We can show that no valid placements are possible.