This code is based on the assignment that was given during the spring semester.
The assignment is one of the versions of the NP-complete task about making the schedule of studying. That's why the only one algo for the solution for this is a brute force of all(actually, almost all) possible variants of schedule.