Problem

Source: Iranian 3rd-Round MO 2019 ; mid-term Combinatorics Exam P3

Tags: rectangle, combinatorics



Cells of a $n*n$ square are filled with positive integers in the way that in the intersection of the $i-$th column and $j-$th row, the number $i+j$ is written. In every step, we can choose two non-intersecting equal rectangles with one dimension equal to $n$ and swap all the numbers inside these two rectangles with one another. ( without reflection or rotation ) Find the minimum number of moves one should do to reach the position where the intersection of the $i-$th column and $j-$row is written $2n+2-i-j$.