All Tracks Algorithms Sorting Bubble Sort Problem

Twisted Matrix
/
No tags
Problem
Editorial
Analytics

A matrix of same rows and same columns is given .Sakshi wants to Sort the matrix in such manner  that she will start from the first element and traverse the matrix in clockwise manner at the end she should be at  the middle position with a largest element  .Find the solution of Sakshi's problem.

 

 **Input**

First line will take the dimension of matrix i.e. N x N (only one input N).

Second input the elements of matrix.

 

**Output**

Sorted Matrix in clockwise manner.

 

 

**Constraints **

0<N<10

 

SAMPLE INPUT
3

2  5  12
22 45 55
1  6  8  
SAMPLE OUTPUT
1 2 5
45 55 6
22 12 8 
Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?