G. Last Day Harvest
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

The Boro harvest in the haor region of Kishoreganj is in progress. A sudden flash flood alert warns that heavy upstream rains will flood the fields. To respond, all farming must be completed exactly within 1 day, neither earlier nor later.

The farming consists of two operations:

  • Harvesting $$$x$$$ units of paddy
  • Drying $$$y$$$ units of paddy
Harvesting is done first, followed by drying.

The village has unlimited workers. A configuration is defined by two positive integers $$$(p, q)$$$, where $$$p$$$ workers are assigned to harvesting and $$$q$$$ workers are assigned to drying. Each worker completes $$$1$$$ unit of work per day, and work is evenly divided among workers. A configuration is considered valid if the sum of the time required to complete harvesting and the time required to complete drying is exactly $$$1$$$ day.

For example, when $$$x = 1$$$ and $$$y = 2$$$:

  • If $$$(p, q) = (3, 3)$$$, then harvesting takes $$$\frac{1}{3}$$$ day and drying takes $$$\frac{2}{3}$$$ day, so the total time is $$$1$$$ day.
  • If $$$(p, q) = (2, 4)$$$, then harvesting takes $$$\frac{1}{2}$$$ day and drying takes $$$\frac{1}{2}$$$ day, so the total time is $$$1$$$ day.

Thus, both configurations are valid.

Your task is to find all valid configurations.

Input

The first line contains an integer $$$t$$$ $$$(1 \le t \le 100)$$$, the number of test cases.

Each of the next $$$t$$$ lines contains two integers $$$x$$$ and $$$y$$$ $$$(1 \le x, y \le 10^7)$$$.

Output

For each test case, print an integer $$$n$$$ on a single line, the number of valid configurations.

Then print $$$n$$$ lines. Each line should contain two positive integers $$$p$$$ and $$$q$$$ separated by a single space, representing a valid configuration.

You may print the configurations in any order.

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