Partitioning a log with minimum cost

24 Views Asked by At

I am struggling with a problem that requires me to find a general pattern and come up with a solving algorithm. The problem goes on like this: You are given a wood log of length L and a number n that represents the number of pieces the log is to be divided into. You are also given n numbers which display the desired lengths for each division respectively. The log can be divided only in two pieces at a time and the cost of division is equal to the length of the log you are currently dividing. The problem requires you to find the minimum amount of money needed to divide this log int n pieces of the specified lengths;