6. Let $n$ be a positive integer. Consider the following game: Initially, $k$ stones are distributed among the $n^{2}$ squares of an $n \times n$ chessboard. A move consists of choosing a square containing at least as many stones as the number of its adjacent squares (two squares are adjacent if they share a common edge) and moving one stone from this square to each of its adjacent squares.

Determine all positive integers $k$ such that:

(a) There is an initial configuration with $k$ stones such that no move is possible.

(b) There is an initial configuration with $k$ stones such that an infinite sequence of moves is possible.
Answer: The possible values of $k$ are all the values in the range $\left[2 n^{2}-2 n, 3 n^{2}-4 n\right]$.