Company: Texas_26july
Difficulty: medium
Matrix Operations Problem Description Consider a square matrix of size M x M, perform the following operation on the matrix, and print the final resultant matrix. Step 1: Arrange the first-row elements in ascending order from left to right, and the second-row elements in descending order from left to right. Continue this loop for all the M rows of the matrix. Step 2: Arrange the first-column elements in ascending order from top to bottom and the second-column elements in ascending order from top to bottom. Continue this loop for all the M columns of the matrix. Step 3: Print the final matrix after all the operations. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the standard output. Constraints The matrix must be always square The size of the square matrix must be less than 100 Input Format The first line of input contains M, the size of the matrix. The next M lines contains the