I. Bingo 3
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

In this problem, you will need to construct a grid with $$$n$$$ rows and $$$n$$$ columns. Each cell of the grid has an integer in it, where $$$a_{i, j}$$$ indicates the integer in the cell located at the $$$i$$$-th row and the $$$j$$$-th column. Each integer from $$$1$$$ to $$$n^2$$$ (both inclusive) appears exactly once in the grid.

We say an integer $$$x$$$ is a "bingo integer" of this grid, if at least one of the two following conditions is satisfied.

  • There is at least one row, where all integers in the cells of that row are less than or equal to $$$x$$$.
  • There is at least one column, where all integers in the cells of that column are less than or equal to $$$x$$$.

It is easy to see that a grid may have multiple bingo integers, however in this problem, we're only interested in the smallest bingo integer.

Given integers $$$n$$$ and $$$k$$$, construct a grid with $$$n$$$ rows and $$$n$$$ columns, such that its smallest bingo integer is exactly $$$k$$$.

Input

There are multiple test cases. The first line of the input contains an integer $$$T$$$ ($$$1 \le T \le 50$$$) indicating the number of test cases. For each test case:

The first and only line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 50$$$, $$$1 \le k \le n^2$$$).

Output

For each test case:

  • If it is possible to construct a grid with $$$n$$$ rows and $$$n$$$ columns, such that its smallest bingo integer is $$$k$$$, first output Yes in one line. Then output $$$n$$$ lines, where the $$$i$$$-th line contains $$$n$$$ integers $$$a_{i, 1}, a_{i, 2}, \cdots, a_{i, n}$$$ separated by a space, indicating the integers on the $$$i$$$-th row of the grid. Don't forget that each integer from $$$1$$$ to $$$n^2$$$ (both inclusive) must appear exactly once in the grid. If there are multiple valid answers, you can output any of them.
  • If it is impossible to find an answer, just output No in one line.
Example
Input
4
3 5
4 10
5 2
1 1
Output
Yes
4 2 5
7 1 9
8 6 3
Yes
14 9 2 13
1 11 16 8
10 3 7 5
6 15 4 12
No
Yes
1