There is a grid with $$$n$$$ rows and $$$m$$$ columns. Consider the following process:
Your task is to fill the grid with integers from $$$1$$$ to $$$10^{9}$$$ in such a way that the number of distinct elements in the set $$$S$$$ is maximized.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The only line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \cdot m \le 3 \cdot 10^5$$$) — the number of rows and columns of the grid.
It is guaranteed that the sum of $$$n\cdot m$$$ over all test cases does not exceed $$$3\cdot 10^{5}$$$.
For each test case, the first line should contain a single integer — the maximum possible number of distinct elements in the set $$$S$$$.
Then, output $$$n$$$ lines, each containing $$$m$$$ space-separated integers. The $$$j$$$-th integer in the $$$i$$$-th line should be the element in the $$$i$$$-th row and $$$j$$$-th column of the grid. All integers in the grid must be from $$$1$$$ to $$$10^9$$$.
If there are multiple possible grids, output any of them.
22 21 4
2 2 5 5 5 2 6 2 3 6
In the first test case, for the output grid:
In the second test case, for the output grid:
| Name |
|---|


