I have trouble with this problem:
I thought it is the same as this problem:
http://www.spoj.pl/problems/PROFIT/
I thought it is a maximum closure problem and I solved it using network flows, but I failed on the first one. Can anyone tell me why or give me some hints?