B5. In a $5 \times 5$ table, we place the numbers 1 through 5 such that each number appears exactly once in each row and each column. A number in a specific row and column of the table is correctly placed if the following two conditions are met:

- In that row, all smaller numbers are to the left of the number and all larger numbers are to the right, or vice versa.
- In that column, all smaller numbers are below the number and all larger numbers are above, or vice versa.

What is the maximum number of correctly placed numbers in such a table?

## C-Problems

For the C-Problems, the answer is not the only thing that matters; your reasoning and the method of solving must also be clearly written. 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. 5 See the left figure below. A well-placed one and a well-placed five can only be in a cell with an $A$ because all other numbers must be on the same side of that number in the same row/column. A well-placed two or four can only be in a cell with a $B$, and a well-placed three can only be in a cell with a $C$.

| $A$ |  |  |  | $A$ |
| :--- | :--- | :--- | :--- | :--- |
|  | $B$ |  | $B$ |  |
|  |  | $C$ |  |  |
|  | $B$ |  | $B$ |  |
| $A$ |  |  |  | $A$ |

| $A$ | 5 |  |  | $A$ |
| :---: | :---: | :---: | :---: | :---: |
| 5 | 4 |  | $B$ |  |
|  |  | $C$ |  |  |
|  | $B$ |  | $B$ |  |
| $A$ |  |  |  | $A$ |

Since no two identical numbers can be in the same row or column, there can be no more than two well-placed ones. Similarly, there can be no more than two well-placed twos, fours, or fives. If there is a well-placed four, then the two adjacent cells must contain fives (see the right figure). On three of the four cells with an $A$, a five cannot stand because otherwise, there would be two fives in the same row or column. With two well-placed fours, no fives can stand on any of those four cells. Therefore, the total number of well-placed fours and fives cannot be more than two.

Similarly, it follows that the total number of well-placed twos and ones cannot be more than two. Thus, we can conclude that there cannot be more than $2+2+1=5$ well-placed numbers in total.

Now, we will show that it is indeed possible to have 5 well-placed numbers. Although one example is sufficient for the proof, we provide two different examples of a square with 5 well-placed numbers.

| $\mathbf{1}$ | 3 | 2 | 4 | $\mathbf{5}$ |
| :--- | :--- | :--- | :--- | :--- |
| 2 | 4 | 1 | 5 | 3 |
| 4 | 5 | 3 | 1 | 2 |
| 3 | 1 | 5 | 2 | 4 |
| $\mathbf{5}$ | 2 | 4 | 3 | $\mathbf{1}$ |

| $\mathbf{1}$ | $\mathbf{5}$ | $\mathbf{2}$ | 4 | 3 |
| :--- | :--- | :--- | :--- | :--- |
| 5 | $\mathbf{4}$ | 1 | 3 | 2 |
| 2 | 1 | $\mathbf{3}$ | 5 | 4 |
| 4 | 3 | 5 | $\mathbf{2}$ | 1 |
| 3 | 2 | 4 | 1 | $\mathbf{5}$ |