Question 11
Let $n$ be an odd integer greater than or equal to $3$. Suppose you play the following game using an $n \times n$ grid made up of $n^2$ $1 \times 1$ squares. The game consists of $n^2$ turns, and at each turn the following actions must be performed in the order specified:
* Choose one empty square and insert one positive integer greater than or equal to $1$ and less than or equal to $n^2$. Throughout the game, any integer can be used only once.
* You gain $1$ point if the sum of numbers written into the squares lying on the same row as the square you chose is a multiple of $n$, and the same rule applies for the column (you get $2$ points if both row sum and column sum are multiples of $n$.)
Find the maximum possible value for the total sum of the points you gain by the end of the game.
* Choose one empty square and insert one positive integer greater than or equal to $1$ and less than or equal to $n^2$. Throughout the game, any integer can be used only once.
* You gain $1$ point if the sum of numbers written into the squares lying on the same row as the square you chose is a multiple of $n$, and the same rule applies for the column (you get $2$ points if both row sum and column sum are multiples of $n$.)
Find the maximum possible value for the total sum of the points you gain by the end of the game.