

For given dimension N = 5 and M = 5 :
[ [X, X, X, X, X],
[X, 0, 0, 0, X],
[X, 0, X, 0, X],
[X, 0, 0, 0, X],
[X, X, X, X, X] ]
The first line of input contains an integer 'T' representing the number of the test case. Then the test case follows.
Each test case contains two integers ‘N’ and ‘M’ which denotes the dimensions of the matrix that you need to create.
For each test case, print the matrix of dimension N x M.
You do not need to print anything; It has already been taken care of. Just implement the given function.
1 ≤ T ≤ 50
1 ≤ N ≤ 100
1 ≤ M ≤ 100
Where ‘T’ is the number of test cases.
‘N’ and ‘M’ are the given dimensions.
Time Limit: 1 sec
Our intuition is to create rectangular frames one by one such that the outermost frame consists of ‘X’s and then that of ‘0’s and again ‘X’s and so on. To implement this we need to create alternate frames of ‘X’s and ‘0’s and thereby create the whole matrix of size ‘N’ x ‘M’.
Steps are as follows: