#P4177. [CEOI 2008] order
[CEOI 2008] order
Description
There are jobs and types of machines. Each type of machine can either be rented or purchased. Each job consists of several operations, and each operation requires a certain type of machine to complete.
You need to maximize the profit.
Input Format
The first line gives .
Then, for each of the jobs:
- The first line gives and , denoting the revenue of this job and the number of operations, respectively.
- The next lines each contain two integers and , denoting the machine required for this operation and the cost of renting this machine for this job, respectively.
Finally, the last lines each contain a positive integer , denoting the cost of purchasing machine .
Output Format
The maximum profit.
2 3
100 2
1 30
2 20
100 2
1 40
3 80
50
80
110
50
Hint
Constraints: For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号