D. Tree Construction
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You're given two integers $$$n,x$$$.Your task is to construct a tree of size $$$n$$$ which's score is $$$x$$$.

The score of a tree is defined as the sum of the distances from all leaf nodes to the root node,where node $$$1$$$ is the root node.

If no solution,output $$$-1$$$ instead.

Input

The first line of input will contain a single integer $$$t(1 \leq t \leq 10^5)$$$, denoting the number of test cases.

The only line of each test case contains two integers $$$n,x(1 \leq n \leq 2*10^5,1 \leq x \leq 10^{18})$$$.

The sum of $$$n$$$ will not exceed $$$2*10^5$$$.

Output

If no solution,output $$$-1$$$ .

Otherwise,for each test case,output $$$n-1$$$ lines.Each line contains two integers $$$u,v$$$,denoting there's an edge connecting node $$$u$$$ and $$$v$$$.

Example
Input
4
2 1
2 2
3 1
4 4
Output
2 1
-1
-1
2 1
3 2
4 2