Let $J$ be all-one matrix ( matrix with all entries 1) and $I$ be an identity matrix. Find the characteristic Polynomial or determinant of $n\times n$ matrix $M$.
$$M= \left[ \begin{array}{cc|c} (J+(n-2)I)_{a\times a}&J_{a\times n-a}\\ J_{n-a\times a}&(2J+(2n-4-a)I)_{n-a\times n-a} \end{array} \right] $$
We can write this matrix as $M = D + AA^T$, where $$ D = \pmatrix{(n-2)I & 0\\0 & (2n - 4 - a) I},\quad A = \pmatrix{e_a & 0\\e_{n-a} & e_{n-a}}, \quad e_n = (1,\dots,1)^T \in \Bbb R^n. $$
With the W-A identity (AKA Sylvester's identity), we have $$ \det(D + AA^T) = \det(D) \det(I + D^{-1}AA^T) = \det(D) \det(I_2 + A^TD^{-1}A). $$ Compute $$ A^T[D^{-1}A] = \pmatrix{e_a & 0\\e_{n-a} & e_{n-a}}^T\pmatrix{\frac 1{n-2}e_a & 0\\\frac{1}{2n - 4 - a}e_{n-a} & \frac 1{2n - 4 - a}{}e_{n-a}}\\ = \pmatrix{\frac{a}{n-2} + \frac{n-a}{2n-4-a} & \frac{n-a}{2n-4-a}\\ \frac{n-a}{2n-4-a} & \frac{n-a}{2n-4-a}}, $$ $\det(D) = (n-2)^a(2n - 4 - a)^{n-a}$, and proceed from there.
The characteristic polynomial can be computed in a similar fashion; we need only replace $D$ with $$ D - \lambda I = \pmatrix{(n-2 - \lambda)I & 0\\0 & (2n - 4 - a - \lambda) I}. $$