#P2751. [IOI 1996 / USACO4.2] 工序安排 Job Processing
[IOI 1996 / USACO4.2] 工序安排 Job Processing
Description
A factory production line is producing a product that requires two types of operations: operation and operation . Only some machines can perform each operation.

The figure above shows the organization of a production line operating as described below. -type machines take workpieces from the input buffer, apply operation , and store the resulting intermediate products in the buffer. -type machines take intermediate products from the buffer, apply operation , and store the final products in the output buffer. All machines work in parallel and independently, and each buffer has unlimited capacity. Each machine may have a different efficiency; a machine requires a fixed amount of time to complete one operation.
Given the processing time of each machine for one operation, compute the minimal total time to finish all operations, and the minimal total time to finish all operations.
Note:
- In one operation, a machine processes exactly one workpiece.
- “Total time” means the latest finishing time (makespan).
Input Format
The first line contains three space-separated integers: , the number of workpieces (); , the number of -type machines (); , the number of -type machines ().
The second line contains integers, the time each -type machine takes to complete one operation; followed by integers, the time each -type machine takes to complete one operation. All operation times for -type and -type machines are integers in .
Output Format
Output a single line with two integers: the minimal total time to complete all operations, and the minimal total time to complete all operations ( operations must be completed before operations).
5 2 3
1 1 3 1 4
3 5
Hint
Problem translation from NOCOW.
USACO Training Section 4.2.
Translated by ChatGPT 5
京公网安备 11011102002149号