Problem in short: There are N people, and person i takes a[i], b[i] and c[i] time to do task a, b, c respectively. Only one person can do task a at a given point of time, and each person must ...
There is no need to sort. It can be done in O(n) with some greedy calculation. My solution is here: SleepyBrain