B5. Simon has 2017 blue blocks numbered from 1 to 2017. He also has 2017 yellow blocks numbered from 1 to 2017. Simon wants to arrange his 4034 blocks in a row. He wants to do so in such a way that for every $k=1,2, \ldots, 2017$ the following conditions are met:

- to the left of the blue block with number $k$ there are $k$ or more yellow blocks;
- to the right of the yellow block with number $k$ there are $k$ or fewer blue blocks.

Determine all possible numbers of the 1000th block from the left in the row.

## C-problems

For the C-problems, not only the answer is important; your reasoning and the way of solving it must also be clearly written down. Solve each C-problem on a separate sheet of paper. Each correctly worked out C-problem is worth 10 points. Partial solutions can also earn points. Therefore, write everything clearly and submit your scratch paper (for each problem!) as well.
B5. 500 First, look at the blue block with the number 2017. All yellow blocks must be to the left of it. This also applies to the yellow block with the number 1. To the right of the yellow 1, there can be at most one blue block; this is the blue 2017. We now see that no other blue blocks can lie to the right of the blue 2017. Therefore, the blue 2017 is the rightmost block in the row.

Now, look at the blue block with the number 2016. This lies to the left of the yellow 1 (which we just established). There must be at least 2016 yellow blocks to the left of the blue 2016. These must be the yellow blocks with the numbers 2 to 2017. We now know that the second block from the right must be the yellow 1.

Now, consider the yellow block with the number 2. This yellow block must lie to the left of the blue 2016 and the blue 2017. All other blue blocks must, in turn, lie to the left of the yellow 2. In this way, we find that the third block from the right is the blue 2016.

We can continue this reasoning and find that there is only one possible row, namely:

$$
G_{2017}, B_{1}, G_{2016}, B_{2}, \ldots, G_{2}, B_{2016}, G_{1}, B_{2017}
$$

The 1000th block from the left is thus the blue 500.

## C-problems