4. Thirty students from five classes came up with 40 tasks, and students from one class came up with the same number of tasks, while students from different classes came up with a different number. How many students came up with one task?
Solution: We will choose 5 students, one from each class. Each of them came up with a different number of problems. Therefore, the total number of problems they came up with is no less than $1+2+3+4+5=$ 15. The remaining 25 students came up with no more than $40-15=25$ problems. It is clear that each of them came up with one problem.

Answer: 26 students.