Find the number of ways in which $2$ identical kings can be placed on an $n\times m$ chessboard so that the kings are not in adjacent squares. Find the number of ways in which $2$ identical kings can be placed on an $n\times m$ chessboard so that the kings are not in adjacent squares.

If king is at the corner square,then it has $3$ neighbouring squares.If king is on the edge square,but not on the corner,then it has $5$ neighbouring squares.If the king is in the interior of chessboard,then there are $8$ neighbouring squares.
I do not know how to solve further.The answer given is $n[\binom{n}{2}-(m-1)]+m[\binom{n}{2}-(n-1)]$.
 A: You need to consider the 3 different types of positions for the first king - corner, edge, center square.
The board will have 4 corners, $2(m+n-4)$ edges, $(n-2)(m-2)$ center squares.
If the first king is placed on a corner there are $nm-4$ possible locations to put the second one.
If the first king is placed on an edge there are $nm-6$ possible locations to put the second one.
If the first king is placed on a center square there are $nm-9$ possible locations to put the second one.
As the two kings are identical we will need to divide the final answer by two.
So joining all the combinations gives:
$$\bigg(4\times(nm-4)+2(m+n-4)\times(nm-6)+(n-2)(m-2)(nm-9)\bigg)\div2$$
$$\bigg(m^2n^2-9mn+6m+6m-4\bigg)\div2$$
This is not algebraically equivalent to your answer so lets example a simple case ($n=m=3$ and count them manual to compare techniques.
\begin{array}{rcl} K & . & 1 \\ . & . & 2 \\ 3 & 4 & 5\end{array}
\begin{array}{rcl} . & K & . \\ . & . & . \\ 6 & 7 & 8\end{array}
There are four possible rotations of each giving 32 total which needs to be divided by 2 to give 16. Comparing this to my formula agrees for $n=m=3$. Your answer gives 6 which is clearly wrong. Maybe you typoed the answer.
A: Assuming $n,m\ge 2$, you have


*

*$4$ corner squares for the first king with each having $nm-4$ possibilities for the second king

*$2m+2n-8$ edge squares for the first king with each having $nm-6$ possibilities for the second king  

*$(n-2)(m-2)$ interior squares for the first king with each having $nm-9$ possibilities for the second king  
So multiply, then add.  Divide by $2$ since the kings can be exchanged.  So you have  $$\tfrac{1}{2}\left(4(nm-4)+ (2m+2n-8)(nm-6) +(n-2)(m-2)(nm-9)  \right)$$ possibilities. You might be able to write this as something like $\dfrac{m^2n^2 -(3m-2)(3n-2)  }{2}$
A: Some hints: One king on one edge or corner disqualify less squares for the second king than if it was on the interior. First imagine you place the first king. Split into cases of edge, corner and interior to decide how many acceptable positions are left for the second king. Then use multiplication for combination of the king's positions.
