#P4014. 分配问题
分配问题
Description
There are jobs to be assigned to people. When person does job , the benefit is . Design an assignment that assigns jobs to people so that the total benefit is minimized or maximized.
Input Format
The first line contains one positive integer , indicating there are jobs to be assigned to people. In the next lines, each line contains integers , where is the benefit when person does job .
Output Format
Output two lines: the minimum total benefit and the maximum total benefit, respectively.
5
2 2 2 1 2
2 3 1 2 4
2 0 1 1 1
2 3 4 3 3
3 2 1 2 1
5
14
Hint
.
Each person can do only one job.
Translated by ChatGPT 5
京公网安备 11011102002149号