Assume you are given t1
, t2
, t3
, ..., tn
amount of tasks to finish every day. And once you start working, you can only finish c1
, c2
, c3
, ..., cn
tasks until spending 1 day resting. You can spend multiple days resting too. But you can only do the tasks which are given you that day. For example;
T[] = {10, 1, 4, 8}
given tasks;C[] = {8, 4, 2, 1}
is the capacity of doing tasks for each day.
For this example, optimal solution is giving a break on the 3rd day. That way you can complete 17 tasks in 4 days:
- 1st day 8 (maximum 10 tasks, but
c1=8
) - 2nd day 1 (maximum 1 task,
c2=4
) - 3rd day 0 (rest to reset to
c1
) - 4th day 8 (maximum 8 tasks,
c1=8
)
Any other schedule would result with fewer tasks getting done.
I'm trying to find the recurrence relation for this dynamic programming problem. Can anyone help me? I find this question but mine is different because of the decreasing work capacity and there are different number of jobs each day. Reference