#P2604. [ZJOI2010] 网络扩容
[ZJOI2010] 网络扩容
Description
Given a directed graph, each edge has a capacity and an expansion cost . The expansion cost is the cost required to increase the capacity by . Find:
- The maximum flow from to without any expansion.
- The minimum total expansion cost required to increase the maximum flow from to by .
Input Format
The first line contains three integers , denoting the number of vertices, the number of edges, and the required increase in flow.
The next lines each contain four integers , describing a directed edge from to with capacity and expansion cost .
Output Format
Output one line containing two integers, which are the answers to problems and respectively.
5 8 2
1 2 5 8
2 5 9 9
5 1 6 2
5 1 1 8
1 2 8 7
2 5 4 9
1 2 1 1
1 4 2 1
13 19
Hint
- Constraints
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that , , , , and .
Translated by ChatGPT 5
京公网安备 11011102002149号