# Print Matrix

Easy
0/40
Average time to solve is 15m
Contributed by

## Problem statement

You are given two integers N and M. You are required to return the matrix of size N * M characters such that every element of the matrix can be X or O, and it must satisfy the following condition.

The Xs and Os must be filled. Alternatively, the matrix should have the outermost rectangle of Xs, then a rectangle of Os, then a rectangle of Xs, and so on.

For Example:
``````N = 3 and M = 3

Required Matrix-

XXX
XOX
XXX
``````
Detailed explanation ( Input/output format, Notes, Images )
Constraints:
``````1 <= T <= 50
1 <= N <= 100
1 <= M <= 100

Time Limit: 1 sec.
``````
##### Sample Input 1:
``````2
4 4
3 4
``````
##### Sample Output 1:
``````XXXX
XOOX
XOOX
XXXX
XXXX
XOOX
XXXX
``````
##### Explaination:
``````In test case 1:
N is 4 and M is also 4, so a matrix of size 4 * 4 is required to output. In the matrix, the outermost rectangle is filled with X and then adjacent to it with O and so on.

Hence the required matrix will be :
XXXX
XOOX
XOOX
XXXX

In test case 2:
N is 3 and M is also 4, so a matrix of size 3 * 4 is required to output. In the matrix, the outermost rectangle is filled with X and then adjacent to it with O and so on.

Hence the required matrix will be :
XXXX
XOOX
XXXX
``````
##### Sample Input 2:
``````2
5 3
1 2
``````
##### Sample Output 2:
``````XXX
XOX
XOX
XOX
XXX
XXX
``````
Console