~/algor $ cat problems/matritsa-diagonallarni-almashtirish
Swap the diagonals
Easy
1000 ms
64 MB
31%
A square matrix of size $n \times n$ is given. In every row, swap the element of the main diagonal with the element of the anti-diagonal: in row $i$, $a_{i,i}$ and $a_{i,n+1-i}$ trade places. Print the resulting matrix.
Input
The first line contains a positive integer $n$.
Each of the next $n$ lines contains $n$ integers — the matrix.
Output
$n$ lines with $n$ integers each.
Note
$1 \le n \le 100$
$-1000 \le a_{i,j} \le 1000$
Examples
Input #1
3 1 2 3 4 5 6 7 8 9
Output #1
3 2 1 4 5 6 9 8 7
Input #2
1 -4
Output #2
-4