$(\mathrm{IMO} 2018, P 4)$

A site is a point $(x, y)$ in the plane such that $x$ and $y$ are positive integers at most 20. Initially, each of the 400 sites is unoccupied. Alice and Bernard take turns placing stones, with Alice starting. On her turn, Alice places a new red stone on an unoccupied site so that the distance between any two sites occupied by red stones is not $\sqrt{5}$. On his turn, Bernard places a new blue stone on an unoccupied site. (A site occupied by a blue stone can be at any distance from an occupied site.) They stop as soon as a player cannot place a stone.

Determine the largest positive integer $K$ such that Alice can ensure placing at least $K$ red stones, regardless of how Bernard places his blue stones.
We will show that the answer is 100.

Firstly, Alice can ensure placing at least 100 red stones. Indeed, we can color the sites in a checkerboard pattern, and Alice can then play only on the black squares. In this case, she cannot have two stones at a distance of $\sqrt{5}$, and she can therefore place her stones arbitrarily to fill at least half of the black squares (with equality if Bob only plays on black squares), which is 100 squares.

Now let's show that Alice cannot do better. Consider a $4 \times 4$ subgrid which we color as follows:

| A | B | C | D |
| :---: | :---: | :---: | :---: |
| C | D | A | B |
| B | A | D | C |
| D | C | B | A |

If Alice plays on a square $A$, for example, she blocks two others, and Bob can play on the last one to prevent Alice from playing on another $A$ square. In this way, Bob can prevent Alice from placing more than 4 stones in the $4 \times 4$ square. By tiling the $20 \times 20$ square with 25 such squares, Bob can prevent Alice from placing more than 100 stones.