SP10088 ASSEMBLY - Assembly Line
Description
The last worker in a production line at the factory of Automated Composed Machinery is worried. She knows that her job hangs in the balance unless her productivity increases. Her work consists of assembling a set of pieces in a given sequence, but the time spent on assembling pieces _a_ and _b_ and then _c_ may not the same as that on assembling pieces _b_ and _c_, and then assembling _a_ with the resulting component. Only two consecutive pieces may be assembled at a time, and once they are assembled they behave as another piece in terms of the time needed for further assembly.
In order to aid her, you need to find the optimal way to assemble all components. The input to your program will be a set of symbols representing (types of) pieces, and a so-called assembly table representing the time it takes to assemble them, as well as the type of the resulting component. For instance, we may have two symbols {_a_,_b_}, and the following table:
_a_ _b_ _a_ 3`-`_b_ 5`-`_b_ _b_ 6`-`_a_ 2`-`_b_
Input Format
N/A
Output Format
N/A