# Wonderful ending!

**Logic**Level 5

In the above position, White to play and checkmate black in the least number of moves. Black plays optimally(i.e. lasts for the most number of moves as he can). We define a **positional value** as the value of the piece* on that square times the product of the coordinates of that square**.

The first \(5\) moves are forced(white can checkmate black in very few moves after that but black has many options which lead to checkmate in the same number of moves after that).

Enter your answer as the sum of the **positional values till white's 5th move**.

**Details and assumptions:**

*Following are the values of all the chess pieces: King=10, Queen=9, Rook=5, Bishop=3, Knight=3, Pawn=1.

If you want to promote a pawn, the value of the piece on that square is **the value of the promoted piece which you want and not the pawn**. You cannot promote a pawn to a king.

**The bottom left corner has the coordinates\((1,1)\), bottom right corner\((8,1)\), top left corner \((1,8) \) and top right corner \((8,8)\),etc.

Example of answer format(these are just random moves and have nothing to do with the position in the problem) :

1.e4 1...c5

2.Nf3 2...d6

3.Bb5+ 3...Bd7

4.Bxd7+ 4...Qxd7

5.Nc3 ...

The answer format will be \( (1 \times 5 \times 4) + (1 \times 3 \times 5) + (3 \times 6 \times 3) + (1 \times 4 \times 6) + (3 \times 2 \times 5) + (3 \times 4 \times 7) + (3 \times 4 \times 7) + (9 \times 4 \times 7) + (3 \times 3 \times 3) = 590 \).

This is a very similar answer format to what is required in the problem.

You may use a calculator to find the positional values.