#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin>>N>>M; atcoder::mf_graphG(N+M+2); int S=N+M,T=N+M+1; long base=0; for(int i=0;i>A; G.add_edge(S,i,A); } for(int i=0;i>B; base+=B; G.add_edge(N+i,T,B); } for(int i=0;i>K; for(;K--;) { int C;cin>>C; G.add_edge(C-1,N+i,(long)1e18); } } cout<