ready_at[i]. There are 4n tasks to run; their lengths are given in durations.
Each task goes on its own core, and every core takes exactly one task. Cores run in parallel: a task of length d on machine i finishes at time ready_at[i] + d.
Return the earliest time by which all tasks can be finished.ready_at=[3, 0], durations=[5, 1, 2, 6, 2, 4, 1, 3] → 6
The machine free at 0 gets 6, 5, 4, 3 and finishes at 6; the one free at 3 gets 2, 2, 1, 1 and finishes at 5. The answer is 6.
ready_at=[7], durations=[2, 9, 4, 4] → 16
There is one machine, so it runs all four tasks: 7 + 9 = 16.
ready_at=[10, 2, 5], durations=[1, 8, 3, 3, 7, 2, 6, 1, 4, 5, 2, 9] → 12
ready_at=[3, 0], durations=[5, 1, 2, 6, 2, 4, 1, 3]
6
Run checks the first 3 tests in your browser. Submit checks all 28 tests on the server, hidden ones included.