I am looking for an algorithm for the following problem:
Given that we need to bake n>5 cakes. We can either decide to bake the cake ourselves or we can choose to let someone else bake the cake. Letting someone else bake the cake costs $k_i$ for cake $i$. When we choose to bake the cake ourselves, it will take a period of $t_i$ time units and the cake needs to be finished before time unit $f$. The goal is to minimize the costs. What is a good algorithm for this problem?