

The first line of input contains an integer ‘T,’ denoting the number of test cases. The test cases follow.
The first line of each test case contains two numbers ‘N’ and ‘M’, denoting the number of rows and columns in the matrix.
The following ‘N’ lines of each test case contain ‘M’ integers of every row (separated by space).
For each test case, print 'N' lines with each line consisting of 'M' integers. (row elements separated by space)
Print the output of each test case in a separate line.
You are not required to print the expected output; it has already been taken care of. Just implement the function.
1 <= T <= 50
1 <= N <= 400
1 <= M <= 400
0 <= MAT[i][j] <= 100
Time Limit: 1 sec
The idea is to perform a swapping operation on each row using the two-pointer technique.
The steps are as follows: