On the test, there were 25 problems of three types: easy ones worth 2 points, medium ones worth 3 points, and hard ones worth 5 points. Correctly solved problems were scored according to their difficulty level, otherwise 0. The best possible total score for the test was 84 points. Petr correctly solved all the easy problems, half of the medium ones, and a third of the hard ones.

How many points did Petr score on his test?

(A. Bohiniková)

Hint. Could there have been exactly four hard problems in the test?
From the problem statement, it follows that in the test, there was an even number of medium-difficulty problems and the number of difficult problems was a multiple of three. We will gradually consider possible numbers of difficult problems and discuss the consequences:

- If there were 3 difficult problems, then the number of medium and easy problems together would be $25-3=22$ and their best possible score would be $84-3 \cdot 5=69$ points. However, this is not possible because the number of medium-difficulty problems was even and easy problems were scored at 2 points each, but 69 is not an even number. (Another reason could be that even 22 medium-difficulty problems would not yield 69 points.)
- If there were 6 difficult problems, then the number of medium and easy problems together would be $25-6=19$ and their best possible score would be $84-6 \cdot 5=54$ points. If medium and easy problems were both scored at 2 points each, then these 19 problems would be scored $2 \cdot 19=38$ points, which is 16 points less than 54. Since the difference in scoring between medium and easy problems is exactly one point, the previous difference of 16 corresponds to the number of medium-difficulty problems. The number of easy problems would then be $19-16=3$. In this case, Petr would have correctly solved 3 easy problems, 8 medium-difficulty problems, and 2 difficult problems. For such a test, he would have earned

$$
3 \cdot 2+8 \cdot 3+2 \cdot 5=40 \text { points. }
$$

- If there were 9 difficult problems, then the number of medium and easy problems together would be $25-9=16$ and their best possible score would be $84-9 \cdot 5=39$ points. However, this is not possible for the same reason as in the first discussed case.
- If there were 12 difficult problems, then the number of medium and easy problems together would be $25-12=13$ and their best possible score would be $84-12 \cdot 5=24$ points. However, this is not possible because 13 easy problems already correspond to 26 points, which is more than 24.
- Further consideration is not necessary, as the observed difference in scoring would only increase.

The only possible solution is that Petr scored 40 points.

Note. Any argument in the above discussion can be replaced by systematic testing and verification of the conditions from the problem statement. A complete discussion in this spirit is very laborious, cannot be required in this category, but should be satisfactorily indicated. Consider this requirement when evaluating the problem.