As I mentioned in my other comment:

> I'd just like to clarify that I'm not saying this is necessarily the solution the problem writers were looking for, or that it will run within the allocated time. Just that it's a feasible solution.

I don't doubt there's a clever dedicated flow algorithm the problem writers intended instead of the blunt tool which is LP.

I solved C using LP. You may attempt to submit a solution here if you want to try: https://open.kattis.com/problems/brideofpipestream

You may view (one of) the judge's solution to this problem (and the rest of the problems) here: https://github.com/SnapDragon64/ACMFinalsSolutions/blob/mast...