Medium Accuracy: 45.09% Submissions: 897 Points: 4
Given a matrix as 2D array, print the matrix in reverse spiral form.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains two integers m and n denoting the size of the matrix(m X n). The next line contains m*n space separated integers in row-wise form.