Replying again, having actually read the problem more carefully: the problem isn’t that simple. There will be a few tens of thousands of variables. The LP is extremely sparse, and I’m sure a good solver could solve it within the time limit, but a little team-notebook-sized dense solver would take at least a few trillion operations to finish and would not be nearly fast enough.
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...