Q3: Suppose you have one machine and a set of n jobs $a_1, a_2, ..., a_n$ to process on that machine.
Each job $a_j$ has a processing time $t_j$, a profit $p_j$ and a deadline $d_j$. The machine can process only one
job at a time, and job $a_j$ must run uninterruptedly for $t_j$ consecutive time units. If job $a_j$ is completed
by its deadline $d_j$, you receive a profit $p_j$, but if it is completed after its deadline, you receive a profit
of 0. Give a DP algorithm to find the schedule that obtains the maximum amount of profit.
Assuming that the processing times and deadlines are integers between 1 to n, the running time
of your algorithm should be polynomial in terms of n. What is the running time of your algorithm?