Given two integers , construct an undirected graph satisfying all of the following conditions.
The degree of a vertex is the number of edges incident to it. If no such graph exists, print -1.
The input is given in the following format:
For each test case, if no valid graph exists, print -1 on a single line.
Otherwise, first print the number of edges (). On each of the next lines, print the endpoints of an edge (), separated by a space.
The first line contains the number of test cases . Each case is given in the following format:
Each edge must satisfy and . The printed graph must satisfy every condition in the statement. If multiple answers exist, print any one.