#P4209. 学习小组
学习小组
Description
There are students and study groups. Each student is willing to join only some of the study groups, and any student can join at most study groups. For each student participating in a study group, the finance office charges a handling fee; different study groups have different fees. If students join the -th study group, the finance office pays a reward of yuan. Subject to making the number of participating students (i.e., the number of distinct students, not the sum over all groups) as large as possible, find the minimum amount of money the finance office must spend.
Input Format
The input consists of multiple lines. The first line contains three positive integers separated by spaces.
The next line contains positive integers, the values of .
The third line contains positive integers, the handling fees required to join each study group.
Then follows an -by- matrix. If the number at row , column is 1, then the -th student is willing to join the -th study group; if it is 0, then the student is unwilling.
Output Format
Output a single integer: the minimum expenditure.
3 3 1
1 2 3
3 2 1
111
111
111
-2
Hint
For of the testdata, , , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号