| Ural Championship 2017 |
|---|
| Закончено |
Today is a celebration, and Aunt Margaret is expecting many guests for a dinner party. For this grand feast, Uncle Henry brought $$$n$$$ square tables and $$$m$$$ chairs from his estate.
Aunt Margaret wants to arrange the square tables of same size to form one or several large rectangular tables, and place the chairs along the perimeter of each large table. It is essential to use all $$$n$$$ tables to maximize the food serving area, and all $$$m$$$ chairs to ensure there's enough seating for all guests. Chairs must be placed in every available spot, which means the total perimeter of all large rectangular tables must equal the number of chairs.
For example, given $$$n=10$$$ and $$$m=18$$$, the available square tables can be combined into two large tables measuring $$$2 \times 4$$$ and $$$1 \times 2$$$, with a total perimeter of exactly $$$18$$$. Another possible arrangement for these parameters could be $$$2 \times 3$$$ and $$$2 \times 2$$$.
Help Margaret arrange the furniture accordingly.
The first line contains an integer $$$T$$$ — the number of test cases ($$$1 \le T \le 200$$$).
Each of the next $$$T$$$ lines contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 1\,000$$$, $$$1 \le m \le 4\,000$$$).
For each test case, output "Yes", if it is possible to arrange the tables as needed, or "No" if it is not possible. If the answer is positive, print the number $$$z$$$ — the total number of large tables, followed by $$$z$$$ lines each containing two integers $$$a_i$$$ and $$$b_i$$$ — the dimensions of each large table ($$$1 \le i \le z$$$).
If multiple solutions exist, output any valid arrangement.
See the example for a clearer understanding of the output format.
410 186 125 201 2
Yes 2 1 2 2 4 No Yes 5 1 1 1 1 1 1 1 1 1 1 No
| Название |
|---|


