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:
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$$$:
Thus, both configurations are valid.
Your task is to find all valid configurations.
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)$$$.
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.
21 11 2
12 222 43 3
| Название |
|---|


