In how many ways can you get from C5 to H2 on a chessboard in the shortest path (the fewest moves) with the king?

![](https://cdn.mathpix.com/cropped/2024_05_02_d3a0bb7409a46987b079g-1.jpg?height=312&width=323&top_left_y=229&top_left_x=890)
Solution. There is a total of 8 squares horizontally and vertically between the two mentioned squares. The king can move diagonally, covering two squares at once, and with horizontal and vertical moves, it can cover one square at a time, so at least 4 moves would be needed. However, 4 diagonal moves would place it in the 1st row, so 4 moves are not enough, thus at least 5 moves are required. The number of non-diagonal moves is even because C5 and H2 are the same color. Accordingly, two types of paths form: 3 diagonal and 2 horizontal right moves, or 5 diagonal moves, with one of them being a diagonal move upwards at some point. Therefore, there are 5 possibilities for the latter (the diagonal upward move can occur in 5 different places), and for the former, as many as the number of ways to choose the positions of the two horizontal moves from the 5 moves. This can be done in $\frac{5 \cdot 4}{2}=10$ ways, so the total number of possibilities is 15. It can be verified on a chessboard that all these paths indeed exist.