Problem

Source: 2021 Irish Mathematical Olympiad P7

Tags: combinatorics, combinatorial geometry, Coloring



Each square of an $n \times n$ grid is coloured either blue or red, where $n$ is a positive integer. There are $k$ blue cells in the grid. Pat adds the sum of the squares of the numbers of blue cells in each row to the sum of the squares of the numbers of blue cells in each column to form $S_B$. He then performs the same calculation on the red cells to compute $S_R$. If $S_B- S_R = 50$, determine (with proof) all possible values of $k$.