Given definition $S = \{ M_{i_1,j_1} + M_{i_2,j_2} + … + M_{i_n,j_n} \: | \: (i_1,…,i_n) \text{ and } (j_1, …, j_n) \text{ are permutations of } [n] \} $
$\implies (1)$ Each element of $S$ is sum of $n$ terms, such that NO two terms belong to the same row or column of Matrix $M$.
Now each element of the Matrix $M$ can be broken into two parts – (a) $n$ part and (b) constant part.
Example – $M_{1,1} = 1 = 0n + 1 \implies$ (a) $n$ part is $0n$ and (b) constant part is $1$.
$M_{n, 2} = 1 = (n-1)n + 2 \implies$ (a) $n$ part is $(n-1)n$ and (b) constant part is $2$.
Now observe $(2)$ constant part of each column of Matrix $M$ is same and $n$ part of each row of Matrix $M$ is same.
From $(1) \text{ and } (2)$, we can conclude that all the summation
$M_{i_1,j_1} + M_{i_2,j_2} + … + M_{i_n,j_n} \text{ such that } (i_1,…,i_n) \text{ and } (j_1, …, j_n) \text{ are permutations of } [n]$
are same and they are equal to summation of all constant parts plus summation of all $n$ parts.
Element of $S = \sum_{i=0}^{(n-1)} i \times n + \sum_{i=1}^n i = n * \frac{(n)(n-1)}{2} + \frac{n(n+1)}{2} = \frac{n}{2} * \{ n^2-n + n + 1 \} = \frac{n}{2} * (n^2 + 1)$
Therefore, $S = \{ \frac{n}{2} * (n^2 + 1) \} $
Answer :- A