MathDB
Moving numbers in a square

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

August 23, 2019
rectanglecombinatorics

Problem Statement

Cells of a nnn*n square are filled with positive integers in the way that in the intersection of the ii-th column and jj-th row, the number i+ji+j is written. In every step, we can choose two non-intersecting equal rectangles with one dimension equal to nn 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 ii-th column and jj-row is written 2n+2ij2n+2-i-j.