Problem F
Sequential Manufacturing
A certain manufacturing process consists of
A good moves automatically through the system once input
into the first system. To give the system some tolerance with
regards to timing, each machine
You just got a huge order of goods, and now wonder – how
quickly can you finish manufacturing these goods, without the
system shutting down? You have an infinite supply of raw
materials, and can choose at which times you put in items in
machine
Input
The first line contains the two integers
The next line contains the processing times
The next line contains the sizes of the input areas
Output
Output the number of seconds it takes to manufacture all the requested items. Manufacturing is considered complete when the last item has been processed by the last machine.
Sample Input 1 | Sample Output 1 |
---|---|
2 3 1 5 100 |
16 |