Let $m\geq 0,n\geq 1$ be fixed integers. I want to compute the determinant of the $(2n+m)\times (2n+m)$ matrix given by $$a_{ij}=\left\{\begin{array}{cl}n+m & \text{if }i=j\leq 2n,\\ 2n& \text{if }i=j> 2n,\\ 0 & \text{if $i\neq j$ and $i,j\leq n$, $n< i, j\leq2n$ or $2n<i,j$,}\\ -1 &\text{otherwise.}\end{array}\right.$$ So, it's the sum of a matrix with diagonal blocks $0$ and every other block $-1$, and a diagonal matrix with the first $2n$ elements being $n+m$ and the rest $2n$.
Or just: $$\begin{bmatrix}D_n({n+m}) & -1 & -1\\ -1 & D_{n}(n+m) & -1\\ -1 & -1 & D_m({2n}) \end{bmatrix}$$
where $D_r(s)$ denotes the diagonal $r\times r$ matrix with diagonal $s$.
I'd like to use something like this, but here the blocks have different sizes and there are some rectangular ones, too.
For the context, I was trying to compute the number of spanning trees of the tripartite graph $K_{n,n,m}$ using the Matrix-Tree Theorem and ended up with that.
One detail is that in the problem I have to remove a row and a column corresponding to one vertex, which I choose to be the last one, but the resulting matrix is still with the same form. Also, for the case of $m=0$ ($m=1$ in the problem) this can be easily solved by this (or any) method since there are only 4 blocks, all of which have the same size, commute and are very simple.