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...