The hardest challenge was the problem Course Selection.
We want to attend N courses over M semesters. There are K course prerequisites (a, b) - we must take course a before b. We're also given a matrix X where X[i][j] is the grade (0..100) obtained if we take course i at semester j or -1 if we can't take the course in that semester.
What is the maximum average grade we can obtain?
It is guaranteed it is possible to take the N courses. Constraints:
- 0 <= N, M, K <= 100
- -1 <= X[i][j] <= 100
For 20% of the points, a course has at most one prerequisite.